/** * Creates an entity-id. * * @param entitySetName the entity-set * @param entityKeyValues the entity-key as one or more values * @return the entity-id */ public static OEntityId create(String entitySetName, Object... entityKeyValues) { return create(entitySetName, OEntityKey.create(entityKeyValues)); }
/** * Creates a new Guid-valued OData property with {@link EdmSimpleType#GUID} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<Guid> guid(String name, String value) { return guid(name, Guid.fromString(value)); }
/** * Creates a new OData property of the given edm-type. * * @param <T> the property value's java-type * @param name the property name * @param type the property edm-type * @param value the property value * @return a new OData property instance */ public static <T> OProperty<T> simple(String name, EdmSimpleType<T> type, Object value) { OSimpleObject<T> simple = OSimpleObjects.create(type, value); return new Impl<T>(name, type, simple.getValue()); }
/** * Gets the values of complex entity-key. * * @return the key values as a set of properties */ public Set<OProperty<?>> asComplexProperties() { assertComplex(); return toSortedSet(Enumerable.create(values).cast(NamedValue.class).select(OFuncs.namedValueToPropertyRaw()), OComparators.propertyByName()); }
/** * Computes the "key string" representation of an entity. * * @param entity the entity * @return the "key string" representation e.g. {@code Customers(15)} */ public static String toKeyString(OEntityId entity) { if (entity == null) return null; return entity.getEntitySetName() + entity.getEntityKey().toKeyString(); }
public TProperty apply(OEntity input) { return input.getProperty(propName, propClass).getValue(); } };
/** * Creates a new OData property of the given edm-type. * * @param <T> the property value's java-type * @param name the property name * @param type the property edm-type * @param value the property value * @return a new OData property instance */ public static <T> OProperty<T> simple(String name, EdmSimpleType<T> type, Object value) { OSimpleObject<T> simple = OSimpleObjects.create(type, value); return new Impl<T>(name, type, simple.getValue()); }
/** * Gets the values of complex entity-key. * * @return the key values as a set of properties */ public Set<OProperty<?>> asComplexProperties() { assertComplex(); return toSortedSet(Enumerable.create(values).cast(NamedValue.class).select(OFuncs.namedValueToPropertyRaw()), OComparators.propertyByName()); }
/** * Computes the "key string" representation of an entity. * * @param entity the entity * @return the "key string" representation e.g. {@code Customers(15)} */ public static String toKeyString(OEntityId entity) { if (entity == null) return null; return entity.getEntitySetName() + entity.getEntityKey().toKeyString(); }
/** * Creates an entity-id. * * @param entitySetName the entity-set * @param entityKeyValues the entity-key as one or more values * @return the entity-id */ public static OEntityId create(String entitySetName, Object... entityKeyValues) { return create(entitySetName, OEntityKey.create(entityKeyValues)); }
/** * Creates a new Guid-valued OData property with {@link EdmSimpleType#GUID} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<Guid> guid(String name, String value) { return guid(name, Guid.fromString(value)); }
/** * Creates a new OData property of the given edm-type. * * @param <T> the property value's java-type * @param name the property name * @param type the property edm-type * @param value the property value * @return a new OData property instance */ public static <T> OProperty<T> simple(String name, EdmSimpleType<T> type, Object value) { OSimpleObject<T> simple = OSimpleObjects.create(type, value); return new Impl<T>(name, type, simple.getValue()); }
/** * Computes the "key string" representation of an entity. * * @param entity the entity * @return the "key string" representation e.g. {@code Customers(15)} */ public static String toKeyString(OEntityId entity) { if (entity == null) return null; return entity.getEntitySetName() + entity.getEntityKey().toKeyString(); }
/** * Creates an entity-id. * * @param entitySetName the entity-set * @param entityKeyValues the entity-key as one or more values * @return the entity-id */ public static OEntityId create(String entitySetName, Object... entityKeyValues) { return create(entitySetName, OEntityKey.create(entityKeyValues)); }
/** * Creates a new Guid-valued OData property with {@link EdmSimpleType#GUID} * * @param name the property name * @param value the property value * @return a new OData property instance */ public static OProperty<Guid> guid(String name, String value) { return guid(name, Guid.fromString(value)); }