@Test public void haveOneTypeShouldPass() { TypeSupplier age = new TypeSupplier("age", ESDataType.INTEGER); assertEquals(ESDataType.INTEGER, age.get()); }
@Override public Type get() { if (types.size() > 1) { throw new SemanticAnalysisException( String.format("Field [%s] have conflict type [%s]", symbolName, types)); } else { return symbolType; } }
TypeSupplier implements Supplier<Type> { @Override public Type get() { if (types.size() > 1) { throw new SemanticAnalysisException( String.format("Field [%s] have conflict type [%s]", symbolName, types)); } else { return symbolType; } } }
TypeSupplier implements Supplier<Type> { @Override public Type get() { if (types.size() > 1) { throw new SemanticAnalysisException( String.format("Field [%s] have conflict type [%s]", symbolName, types)); } else { return symbolType; } } TypeSupplier(String symbolName, Type symbolType); }
TypeSupplier implements Supplier<Type> { @Override public Type get() { if (types.size() > 1) { throw new SemanticAnalysisException( String.format("Field [%s] have conflict type [%s]", symbolName, types)); } else { return symbolType; } } TypeSupplier(String symbolName, Type symbolType); TypeSupplier add(Type type); @Override Type get(); }
TypeSupplier implements Supplier<Type> { @Override public Type get() { if (types.size() > 1) { throw new SemanticAnalysisException( String.format("Field [%s] have conflict type [%s]", symbolName, types)); } else { return symbolType; } } TypeSupplier(String symbolName, Type symbolType); TypeSupplier add(Type type); @Override Type get();  }