Class ModelSpecBuilder<T>


  • public class ModelSpecBuilder<T>
    extends java.lang.Object
    • Method Detail

      • build

        public ModelSpec<T> build()
        Build a new ModelSpec instance
        Returns:
        new ModelSpec instance
      • withCreateMode

        public ModelSpecBuilder<T> withCreateMode​(org.apache.zookeeper.CreateMode createMode)
        Use the given createMode for create operations on the Modeled Curator's ZNode
        Parameters:
        createMode - create mode
        Returns:
        this for chaining
      • withTtl

        public ModelSpecBuilder<T> withTtl​(long ttl)
        Specify a TTL when mode is CreateMode.PERSISTENT_WITH_TTL or CreateMode.PERSISTENT_SEQUENTIAL_WITH_TTL. If the znode has not been modified within the given TTL, it will be deleted once it has no children. The TTL unit is milliseconds and must be greater than 0 and less than or equal to EphemeralType.MAX_TTL.
        Parameters:
        ttl - the ttl
        Returns:
        this for chaining
      • withAclList

        public ModelSpecBuilder<T> withAclList​(java.util.List<org.apache.zookeeper.data.ACL> aclList)
        Use the given aclList for create operations on the Modeled Curator's ZNode
        Parameters:
        aclList - ACLs
        Returns:
        this for chaining
      • withCreateOptions

        public ModelSpecBuilder<T> withCreateOptions​(java.util.Set<CreateOption> createOptions)
        Use the given create options on the Modeled Curator's ZNode
        Parameters:
        createOptions - options
        Returns:
        this for chaining
      • withDeleteOptions

        public ModelSpecBuilder<T> withDeleteOptions​(java.util.Set<DeleteOption> deleteOptions)
        Use the given delete options on the Modeled Curator's ZNode
        Parameters:
        deleteOptions - options
        Returns:
        this for chaining
      • withPath

        public ModelSpecBuilder<T> withPath​(ZPath path)
        Change the model spec's path
        Parameters:
        path - new path
        Returns:
        this for chaining