@SuppressWarnings( "unchecked" ) private <T> T createInstance( ValueBuilder<?> builder ) { return (T) builder.newInstance(); } }
public ValueCompositeType( ValueDescriptor model ) { super( model.types() ); this.model = model; }
/** * Set {@link #INCLUDE_TYPE_INFO} option to TRUE. * @return This */ public Options withTypeInfo() { return put( INCLUDE_TYPE_INFO, true ); }
public T newInstance( Module module ) { ValueBuilder<T> builder = module.newValueBuilder( type ); build( builder.prototype() ); return builder.newInstance(); } }
private String createAndEscapeJSONString( Object value ) { return escapeJSONString( valueSerializer.serialize( new Options().withoutTypeInfo(), value ) ); }
public TableBuilder(ValueBuilderFactory vbf) { this.vbf = vbf; tableBuilder = vbf.newValueBuilder(Table.class); }
@Override public CryptoStoreValue get( String uri ) { String jsonCryptoStore = restClient.getJSON( uri ); return vbf.newValueFromJSON( CryptoStoreValue.class, jsonCryptoStore ); }
public Iterable<? extends AssociationDescriptor> namedAssociations() { return model.state().namedAssociations(); } }
public Links newLinks() { return linksBuilder.newInstance(); } }
public LinksBuilder( ValueBuilderFactory vbf ) { this.vbf = vbf; linksBuilder = vbf.newValueBuilder( Links.class ); linkBuilder = vbf.newValueBuilder( Link.class ); }
@Override public CAValue get( String uri ) { String jsonCa = restClient.getJSON( uri ); return vbf.newValueFromJSON( CAValue.class, jsonCa ); }
public Iterable<? extends AssociationDescriptor> manyAssociations() { return model.state().manyAssociations(); }
/** * Set {@link #INCLUDE_TYPE_INFO} option to FALSE. * @return This */ public Options withoutTypeInfo() { return put( INCLUDE_TYPE_INFO, false ); }
public Table newTable() { if (rowBuilder != null) endRow(); return tableBuilder.newInstance(); }
public QueryBuilder( ValueBuilderFactory vbf ) { queryBuilder = vbf.newValueBuilder( TableQuery.class ); }
@Override public CaApiURIsValue fetchApiURIs() { String jsonApi = getJSON( API_URI ); return valueBuilderFactory.newValueFromJSON( CaApiURIsValue.class, jsonApi ); }
public Options withMapEntriesAsKeyValuePairs() { return put( MAP_ENTRIES_AS_OBJECTS, false ); }
public TableBuilder row() { if (rowBuilder != null) endRow(); rowBuilder = vbf.newValueBuilder(Row.class); return this; }
@Override public CaApiURIsValue fetchApiURIs() { String jsonApi = getJSON( API_URI ); return valueBuilderFactory.newValueFromJSON( CaApiURIsValue.class, jsonApi ); }
public Options withMapEntriesAsObjects() { return put( MAP_ENTRIES_AS_OBJECTS, true ); }