metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arjansh <...@git.apache.org>
Subject [GitHub] metamodel pull request #179: Feature/neo4j column types
Date Tue, 22 May 2018 14:15:07 GMT
Github user arjansh commented on a diff in the pull request:

    https://github.com/apache/metamodel/pull/179#discussion_r189915253
  
    --- Diff: neo4j/src/main/java/org/apache/metamodel/neo4j/utils/AbstractColumnTypeHandler.java
---
    @@ -0,0 +1,33 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.metamodel.neo4j.utils;
    +
    +import org.apache.metamodel.schema.ColumnType;
    +import org.json.JSONObject;
    +
    +public abstract class AbstractColumnTypeHandler implements ColumnTypeHandler {
    +    protected ColumnTypeHandler _successor;
    +
    +    @Override
    +    public void setSuccessor(final ColumnTypeHandler successor) {
    --- End diff --
    
    In theory this setSuccessor method makes the code very flexible, but in this use case
it adds flexibility which is not actually used, because each type of `ColumnTypeHandler` has
one successor, which is now non-statically defined in the ColumnTypeResolver#getTypeFromValue(JSONObject,
String) method, but which is actually static and could as well be defined within the class's
definition.


---

Mime
View raw message