Class PropertySchema
- java.lang.Object
-
- org.opencastproject.assetmanager.api.query.PropertySchema
-
public abstract class PropertySchema extends Object
The schema class helps to build type safe and easy to use property schemas. It makes code using properties more readable and reliable.
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringnamespaceprotected AQueryBuilderq
-
Constructor Summary
Constructors Constructor Description PropertySchema(AQueryBuilder q, String namespace)Create a new property schema.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TargetallProperties()Get a target to select all properties of the schema's namespace.protected PropertyField<Boolean>booleanProp(String name)Create a property field for Booleans.protected PropertyField<Date>dateProp(String name)Create a property field for Dates.PredicatehasPropertiesOfNamespace()Get a predicate that matches if a property of the schema's namespace exists.protected PropertyField<Long>longProp(String name)Create a property field for Longs.Stringnamespace()Get the namespace of the schema.protected <A> PropertyField<A>prop(Value.ValueType<A> ev, String name)Generic property field constructor.protected PropertyField<String>stringProp(String name)Create a property field for Strings.protected PropertyField<Version>versionProp(String name)Create a property field for Versions.
-
-
-
Field Detail
-
q
protected final AQueryBuilder q
-
namespace
protected final String namespace
-
-
Constructor Detail
-
PropertySchema
public PropertySchema(AQueryBuilder q, String namespace)
Create a new property schema.- Parameters:
q- a query buildernamespace-
-
-
Method Detail
-
namespace
public String namespace()
Get the namespace of the schema.
-
hasPropertiesOfNamespace
public Predicate hasPropertiesOfNamespace()
Get a predicate that matches if a property of the schema's namespace exists.
-
allProperties
public Target allProperties()
Get a target to select all properties of the schema's namespace.
-
prop
protected <A> PropertyField<A> prop(Value.ValueType<A> ev, String name)
Generic property field constructor.
-
stringProp
protected PropertyField<String> stringProp(String name)
Create a property field for Strings.
-
longProp
protected PropertyField<Long> longProp(String name)
Create a property field for Longs.
-
booleanProp
protected PropertyField<Boolean> booleanProp(String name)
Create a property field for Booleans.
-
dateProp
protected PropertyField<Date> dateProp(String name)
Create a property field for Dates.
-
versionProp
protected PropertyField<Version> versionProp(String name)
Create a property field for Versions.
-
-