@Override public boolean containsValue(Object value) { if (!Primitives.wrap(type.getJavaType()).isInstance(value)) { throw new IllegalArgumentException(String.format("Value class %s does not match required Type class %s", value.getClass().getName(), Primitives.wrap(type.getJavaType()).getClass().getName())); } return all; }
public NullableValue(Type type, Object value) { requireNonNull(type, "type is null"); if (value != null && !Primitives.wrap(type.getJavaType()).isInstance(value)) { throw new IllegalArgumentException(String.format("Object '%s' does not match type %s", value, type.getJavaType())); } this.type = type; this.value = value; }
public static Block nativeValueToBlock(Type type, Object object) { if (object != null && !Primitives.wrap(type.getJavaType()).isInstance(object)) { throw new IllegalArgumentException(String.format("Object '%s' does not match type %s", object, type.getJavaType())); } BlockBuilder blockBuilder = type.createBlockBuilder(null, 1); writeNativeValue(type, blockBuilder, object); return blockBuilder.build(); }
@Override public boolean containsValue(Object value) { if (!Primitives.wrap(type.getJavaType()).isInstance(value)) { throw new IllegalArgumentException(String.format("Value class %s does not match required Type class %s", value.getClass().getName(), Primitives.wrap(type.getJavaType()).getClass().getName())); } return all; }
public NullableValue(Type type, Object value) { requireNonNull(type, "type is null"); if (value != null && !Primitives.wrap(type.getJavaType()).isInstance(value)) { throw new IllegalArgumentException(String.format("Object '%s' does not match type %s", value, type.getJavaType())); } this.type = type; this.value = value; }
public static Block nativeValueToBlock(Type type, Object object) { if (object != null && !Primitives.wrap(type.getJavaType()).isInstance(object)) { throw new IllegalArgumentException(String.format("Object '%s' does not match type %s", object, type.getJavaType())); } BlockBuilder blockBuilder = type.createBlockBuilder(null, 1); writeNativeValue(type, blockBuilder, object); return blockBuilder.build(); }