Class ListenerBuilder

  • All Implemented Interfaces:
    org.opendaylight.yangtools.concepts.Builder<Listener>, org.opendaylight.yangtools.concepts.CheckedBuilder<Listener,​IllegalArgumentException>, org.opendaylight.yangtools.concepts.Mutable, org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>

    public class ListenerBuilder
    extends Object
    implements org.opendaylight.yangtools.concepts.Builder<Listener>
    Class that builds ListenerBuilder instances. Overall design of the class is that of a fluent interface, where method chaining is used.

    In general, this class is supposed to be used like this template:

       
         ListenerBuilder createTarget(int fooXyzzy, int barBaz) {
             return new ListenerBuilderBuilder()
                 .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
                 .setBar(new BarBuilder().setBaz(barBaz).build())
                 .build();
         }
       
     

    This pattern is supported by the immutable nature of ListenerBuilder, as instances can be freely passed around without worrying about synchronization issues.

    As a side note: method chaining results in:

    • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is on the stack, so further method invocations just need to fill method arguments for the next method invocation, which is terminated by build(), which is then returned from the method
    • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is very localized
    • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than method) stack, making escape analysis a lot easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely eliminated
    See Also:
    ListenerBuilder, Builder
    • Constructor Detail

      • ListenerBuilder

        public ListenerBuilder()
      • ListenerBuilder

        public ListenerBuilder​(IdAttributes arg)
      • ListenerBuilder

        public ListenerBuilder​(Listener base)
    • Method Detail

      • fieldsFrom

        public void fieldsFrom​(org.opendaylight.yangtools.yang.binding.DataObject arg)
        Set fields from given grouping argument. Valid argument is instance of one of following types:
        • org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.attrs.rev150712.IdAttributes
        • org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.ListenerAttributes
        • org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.attrs.rev150712.BaseAttributes
        Parameters:
        arg - grouping object
        Throws:
        IllegalArgumentException - if given argument is none of valid types
      • getConnectionLimit

        public Integer getConnectionLimit()
      • getDefaultPoolId

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid getDefaultPoolId()
      • getLoadbalancers

        public List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> getLoadbalancers()
      • getName

        public String getName()
      • getProjectId

        public String getProjectId()
      • getProtocolPort

        public org.opendaylight.yangtools.yang.common.Uint16 getProtocolPort()
      • getRevisionNumber

        public Long getRevisionNumber()
      • getTenantId

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid getTenantId()
      • getUuid

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid getUuid()
      • isAdminStateUp

        public Boolean isAdminStateUp()
      • augmentation

        public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Listener>> E$$ augmentation​(Class<E$$> augmentationType)
      • setDefaultPoolId

        public ListenerBuilder setDefaultPoolId​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid value)
      • setLoadbalancers

        public ListenerBuilder setLoadbalancers​(List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> values)
      • setProtocolPort

        public ListenerBuilder setProtocolPort​(org.opendaylight.yangtools.yang.common.Uint16 value)
      • setProtocolPort

        @Deprecated(forRemoval=true)
        public ListenerBuilder setProtocolPort​(Integer value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use {#link setProtocolPort(Uint16)} instead.
        Utility migration setter.
        Parameters:
        value - field value in legacy type
        Returns:
        this builder
      • setTenantId

        public ListenerBuilder setTenantId​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid value)
      • setUuid

        public ListenerBuilder setUuid​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid value)
      • addAugmentation

        public ListenerBuilder addAugmentation​(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Listener>> augmentationType,
                                               org.opendaylight.yangtools.yang.binding.Augmentation<Listener> augmentationValue)
      • removeAugmentation

        public ListenerBuilder removeAugmentation​(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Listener>> augmentationType)
      • build

        public Listener build()
        Specified by:
        build in interface org.opendaylight.yangtools.concepts.Builder<Listener>
        Specified by:
        build in interface org.opendaylight.yangtools.concepts.CheckedBuilder<Listener,​IllegalArgumentException>