Class ModelSpecImpl<T>
- java.lang.Object
-
- org.apache.curator.x.async.modeled.details.ModelSpecImpl<T>
-
- All Implemented Interfaces:
org.apache.curator.framework.schema.SchemaValidator,ModelSpec<T>,Resolvable
public class ModelSpecImpl<T> extends java.lang.Object implements ModelSpec<T>, org.apache.curator.framework.schema.SchemaValidator
-
-
Field Summary
-
Fields inherited from interface org.apache.curator.x.async.modeled.ModelSpec
defaultCreateOptions, defaultDeleteOptions
-
-
Constructor Summary
Constructors Constructor Description ModelSpecImpl(ZPath path, ModelSerializer<T> serializer, org.apache.zookeeper.CreateMode createMode, java.util.List<org.apache.zookeeper.data.ACL> aclList, java.util.Set<CreateOption> createOptions, java.util.Set<DeleteOption> deleteOptions, long ttl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<org.apache.zookeeper.data.ACL>aclList()Return the model's ACL listModelSpec<T>child(java.lang.Object child)Return a new CuratorModel instance with all the same options but applying to the given child node of this CuratorModel's path.org.apache.zookeeper.CreateModecreateMode()Return the model's create modejava.util.Set<CreateOption>createOptions()Return the model's create optionsjava.util.Set<DeleteOption>deleteOptions()Return the model's delete optionsbooleanequals(java.lang.Object o)inthashCode()booleanisValid(org.apache.curator.framework.schema.Schema schema, java.lang.String path, byte[] data, java.util.List<org.apache.zookeeper.data.ACL> acl)ModelSpec<T>parent()Return a new CuratorModel instance with all the same options but applying to the parent node of this CuratorModel's path.ZPathpath()Return the model's pathModelSpec<T>resolved(java.lang.Object... parameters)Return a new CuratorModel instance with all the same options but using a resolved path by callingZPath.resolved(Object...)using the given parametersModelSpec<T>resolved(java.util.List<java.lang.Object> parameters)Return a new CuratorModel instance with all the same options but using a resolved path by callingZPath.resolved(java.util.List)using the given parametersorg.apache.curator.framework.schema.Schemaschema()Return a Curator schema that validates ZNodes at this model's path using this model's valuesModelSerializer<T>serializer()Return the model's serializerjava.lang.StringtoString()longttl()Return the TTL to use or -1ModelSpec<T>withPath(ZPath newPath)Return a new CuratorModel instance with all the same options but using the given path.
-
-
-
Constructor Detail
-
ModelSpecImpl
public ModelSpecImpl(ZPath path, ModelSerializer<T> serializer, org.apache.zookeeper.CreateMode createMode, java.util.List<org.apache.zookeeper.data.ACL> aclList, java.util.Set<CreateOption> createOptions, java.util.Set<DeleteOption> deleteOptions, long ttl)
-
-
Method Detail
-
child
public ModelSpec<T> child(java.lang.Object child)
Description copied from interface:ModelSpecReturn a new CuratorModel instance with all the same options but applying to the given child node of this CuratorModel's path. E.g. if this CuratorModel instance applies to "/a/b", calling
modeled.at("c")returns an instance that applies to "/a/b/c".The replacement is the
toString()value of child or, if it implementsNodeName, the value ofnodeName().
-
parent
public ModelSpec<T> parent()
Description copied from interface:ModelSpecReturn a new CuratorModel instance with all the same options but applying to the parent node of this CuratorModel's path. E.g. if this CuratorModel instance applies to "/a/b/c", calling
modeled.parent()returns an instance that applies to "/a/b".The replacement is the
toString()value of child or, if it implementsNodeName, the value ofnodeName().
-
resolved
public ModelSpec<T> resolved(java.lang.Object... parameters)
Description copied from interface:ModelSpecReturn a new CuratorModel instance with all the same options but using a resolved path by calling
ZPath.resolved(Object...)using the given parametersThe replacement is the
toString()value of the parameter object or, if the object implementsNodeName, the value ofnodeName().- Specified by:
resolvedin interfaceModelSpec<T>- Specified by:
resolvedin interfaceResolvable- Parameters:
parameters- list of replacements. Must have be the same length as the number of parameter nodes in the path- Returns:
- new resolved ModelSpec
-
resolved
public ModelSpec<T> resolved(java.util.List<java.lang.Object> parameters)
Description copied from interface:ModelSpecReturn a new CuratorModel instance with all the same options but using a resolved path by calling
ZPath.resolved(java.util.List)using the given parametersThe replacement is the
toString()value of the parameter object or, if the object implementsNodeName, the value ofnodeName().- Specified by:
resolvedin interfaceModelSpec<T>- Specified by:
resolvedin interfaceResolvable- Parameters:
parameters- list of replacements. Must have be the same length as the number of parameter nodes in the path- Returns:
- new resolved ModelSpec
-
withPath
public ModelSpec<T> withPath(ZPath newPath)
Description copied from interface:ModelSpecReturn a new CuratorModel instance with all the same options but using the given path.
-
serializer
public ModelSerializer<T> serializer()
Description copied from interface:ModelSpecReturn the model's serializer- Specified by:
serializerin interfaceModelSpec<T>- Returns:
- serializer
-
createMode
public org.apache.zookeeper.CreateMode createMode()
Description copied from interface:ModelSpecReturn the model's create mode- Specified by:
createModein interfaceModelSpec<T>- Returns:
- create mode
-
aclList
public java.util.List<org.apache.zookeeper.data.ACL> aclList()
Description copied from interface:ModelSpecReturn the model's ACL list
-
createOptions
public java.util.Set<CreateOption> createOptions()
Description copied from interface:ModelSpecReturn the model's create options- Specified by:
createOptionsin interfaceModelSpec<T>- Returns:
- create options
-
deleteOptions
public java.util.Set<DeleteOption> deleteOptions()
Description copied from interface:ModelSpecReturn the model's delete options- Specified by:
deleteOptionsin interfaceModelSpec<T>- Returns:
- delete options
-
ttl
public long ttl()
Description copied from interface:ModelSpecReturn the TTL to use or -1
-
schema
public org.apache.curator.framework.schema.Schema schema()
Description copied from interface:ModelSpecReturn a Curator schema that validates ZNodes at this model's path using this model's values
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isValid
public boolean isValid(org.apache.curator.framework.schema.Schema schema, java.lang.String path, byte[] data, java.util.List<org.apache.zookeeper.data.ACL> acl)- Specified by:
isValidin interfaceorg.apache.curator.framework.schema.SchemaValidator
-
-