java.lang.Object
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.lspa.object.LspaBuilder

@Generated("mdsal-binding-generator") public class LspaBuilder extends Object
Class that builds Lspa 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:

   
     Lspa createLspa(int fooXyzzy, int barBaz) {
         return new LspaBuilder()
             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
             .setBar(new BarBuilder().setBaz(barBaz).build())
             .build();
     }
   
 

This pattern is supported by the immutable nature of Lspa, 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 opportunities, 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:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct an empty builder.
    Construct a builder initialized with state from specified Lspa.
    Construct a new builder initialized from specified ObjectHeader.
    LspaBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilters arg)
    Construct a new builder initialized from specified AttributeFilters.
    LspaBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.Priority arg)
    Construct a new builder initialized from specified Priority.
    LspaBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.TunnelAttributes arg)
    Construct a new builder initialized from specified TunnelAttributes.
  • Method Summary

    Modifier and Type
    Method
    Description
    addAugmentation(org.opendaylight.yangtools.binding.Augmentation<Lspa> augmentation)
    Add an augmentation to this builder's product.
    <E$$ extends org.opendaylight.yangtools.binding.Augmentation<Lspa>>
    E$$
    augmentation(Class<E$$> augmentationType)
    Return the specified augmentation, if it is present in this builder.
    @NonNull Lspa
    A new Lspa instance.
    static @NonNull Lspa
    Get empty instance of Lspa.
    void
    fieldsFrom(org.opendaylight.yangtools.binding.Grouping arg)
    Set fields from given grouping argument.
    org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter
    Return current value associated with the property corresponding to AttributeFilters.getExcludeAny().
    org.opendaylight.yangtools.yang.common.Uint8
    Return current value associated with the property corresponding to Priority.getHoldPriority().
    Return current value associated with the property corresponding to ObjectHeader.getIgnore().
    org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter
    Return current value associated with the property corresponding to AttributeFilters.getIncludeAll().
    org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter
    Return current value associated with the property corresponding to AttributeFilters.getIncludeAny().
    Return current value associated with the property corresponding to TunnelAttributes.getLabelRecordingDesired().
    Return current value associated with the property corresponding to TunnelAttributes.getLocalProtectionDesired().
    Return current value associated with the property corresponding to ObjectHeader.getProcessingRule().
    Return current value associated with the property corresponding to TunnelAttributes.getSessionName().
    Return current value associated with the property corresponding to TunnelAttributes.getSeStyleDesired().
    org.opendaylight.yangtools.yang.common.Uint8
    Return current value associated with the property corresponding to Priority.getSetupPriority().
    Return current value associated with the property corresponding to Lspa.getTlvs().
    removeAugmentation(Class<? extends org.opendaylight.yangtools.binding.Augmentation<Lspa>> augmentationType)
    Remove an augmentation from this builder's product.
    setExcludeAny(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter value)
    Set the property corresponding to AttributeFilters.getExcludeAny() to the specified value.
    setHoldPriority(org.opendaylight.yangtools.yang.common.Uint8 value)
    Set the property corresponding to Priority.getHoldPriority() to the specified value.
    Set the property corresponding to ObjectHeader.getIgnore() to the specified value.
    setIncludeAll(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter value)
    Set the property corresponding to AttributeFilters.getIncludeAll() to the specified value.
    setIncludeAny(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter value)
    Set the property corresponding to AttributeFilters.getIncludeAny() to the specified value.
    Set the property corresponding to TunnelAttributes.getLabelRecordingDesired() to the specified value.
    Set the property corresponding to TunnelAttributes.getLocalProtectionDesired() to the specified value.
    Set the property corresponding to ObjectHeader.getProcessingRule() to the specified value.
    Set the property corresponding to TunnelAttributes.getSessionName() to the specified value.
    Set the property corresponding to TunnelAttributes.getSeStyleDesired() to the specified value.
    setSetupPriority(org.opendaylight.yangtools.yang.common.Uint8 value)
    Set the property corresponding to Priority.getSetupPriority() to the specified value.
    setTlvs(Tlvs value)
    Set the property corresponding to Lspa.getTlvs() to the specified value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LspaBuilder

      public LspaBuilder()
      Construct an empty builder.
    • LspaBuilder

      public LspaBuilder(ObjectHeader arg)
      Construct a new builder initialized from specified ObjectHeader.
      Parameters:
      arg - ObjectHeader from which the builder should be initialized
    • LspaBuilder

      public LspaBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.TunnelAttributes arg)
      Construct a new builder initialized from specified TunnelAttributes.
      Parameters:
      arg - TunnelAttributes from which the builder should be initialized
    • LspaBuilder

      public LspaBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.Priority arg)
      Construct a new builder initialized from specified Priority.
      Parameters:
      arg - Priority from which the builder should be initialized
    • LspaBuilder

      public LspaBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilters arg)
      Construct a new builder initialized from specified AttributeFilters.
      Parameters:
      arg - AttributeFilters from which the builder should be initialized
    • LspaBuilder

      public LspaBuilder(Lspa base)
      Construct a builder initialized with state from specified Lspa.
      Parameters:
      base - Lspa from which the builder should be initialized
  • Method Details

    • fieldsFrom

      public void fieldsFrom(org.opendaylight.yangtools.binding.Grouping arg)
      Set fields from given grouping argument. Valid argument is instance of one of following types:
      Parameters:
      arg - grouping object
      Throws:
      IllegalArgumentException - if given argument is none of valid types or has property with incompatible value
    • empty

      public static @NonNull Lspa empty()
      Get empty instance of Lspa.
      Returns:
      An empty Lspa
    • getExcludeAny

      public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter getExcludeAny()
      Return current value associated with the property corresponding to AttributeFilters.getExcludeAny().
      Returns:
      current value
    • getHoldPriority

      public org.opendaylight.yangtools.yang.common.Uint8 getHoldPriority()
      Return current value associated with the property corresponding to Priority.getHoldPriority().
      Returns:
      current value
    • getIgnore

      public Boolean getIgnore()
      Return current value associated with the property corresponding to ObjectHeader.getIgnore().
      Returns:
      current value
    • getIncludeAll

      public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter getIncludeAll()
      Return current value associated with the property corresponding to AttributeFilters.getIncludeAll().
      Returns:
      current value
    • getIncludeAny

      public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter getIncludeAny()
      Return current value associated with the property corresponding to AttributeFilters.getIncludeAny().
      Returns:
      current value
    • getLabelRecordingDesired

      public Boolean getLabelRecordingDesired()
      Return current value associated with the property corresponding to TunnelAttributes.getLabelRecordingDesired().
      Returns:
      current value
    • getLocalProtectionDesired

      public Boolean getLocalProtectionDesired()
      Return current value associated with the property corresponding to TunnelAttributes.getLocalProtectionDesired().
      Returns:
      current value
    • getProcessingRule

      public Boolean getProcessingRule()
      Return current value associated with the property corresponding to ObjectHeader.getProcessingRule().
      Returns:
      current value
    • getSeStyleDesired

      public Boolean getSeStyleDesired()
      Return current value associated with the property corresponding to TunnelAttributes.getSeStyleDesired().
      Returns:
      current value
    • getSessionName

      public String getSessionName()
      Return current value associated with the property corresponding to TunnelAttributes.getSessionName().
      Returns:
      current value
    • getSetupPriority

      public org.opendaylight.yangtools.yang.common.Uint8 getSetupPriority()
      Return current value associated with the property corresponding to Priority.getSetupPriority().
      Returns:
      current value
    • getTlvs

      public Tlvs getTlvs()
      Return current value associated with the property corresponding to Lspa.getTlvs().
      Returns:
      current value
    • augmentation

      public <E$$ extends org.opendaylight.yangtools.binding.Augmentation<Lspa>> E$$ augmentation(Class<E$$> augmentationType)
      Return the specified augmentation, if it is present in this builder.
      Type Parameters:
      E$$ - augmentation type
      Parameters:
      augmentationType - augmentation type class
      Returns:
      Augmentation object from this builder, or null if not present
      Throws:
      NullPointerException - if augmentType is null
    • setExcludeAny

      public LspaBuilder setExcludeAny(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter value)
      Set the property corresponding to AttributeFilters.getExcludeAny() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setHoldPriority

      public LspaBuilder setHoldPriority(org.opendaylight.yangtools.yang.common.Uint8 value)
      Set the property corresponding to Priority.getHoldPriority() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setIgnore

      public LspaBuilder setIgnore(Boolean value)
      Set the property corresponding to ObjectHeader.getIgnore() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setIncludeAll

      public LspaBuilder setIncludeAll(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter value)
      Set the property corresponding to AttributeFilters.getIncludeAll() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setIncludeAny

      public LspaBuilder setIncludeAny(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter value)
      Set the property corresponding to AttributeFilters.getIncludeAny() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setLabelRecordingDesired

      public LspaBuilder setLabelRecordingDesired(Boolean value)
      Set the property corresponding to TunnelAttributes.getLabelRecordingDesired() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setLocalProtectionDesired

      public LspaBuilder setLocalProtectionDesired(Boolean value)
      Set the property corresponding to TunnelAttributes.getLocalProtectionDesired() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setProcessingRule

      public LspaBuilder setProcessingRule(Boolean value)
      Set the property corresponding to ObjectHeader.getProcessingRule() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setSeStyleDesired

      public LspaBuilder setSeStyleDesired(Boolean value)
      Set the property corresponding to TunnelAttributes.getSeStyleDesired() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setSessionName

      public LspaBuilder setSessionName(String value)
      Set the property corresponding to TunnelAttributes.getSessionName() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setSetupPriority

      public LspaBuilder setSetupPriority(org.opendaylight.yangtools.yang.common.Uint8 value)
      Set the property corresponding to Priority.getSetupPriority() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setTlvs

      public LspaBuilder setTlvs(Tlvs value)
      Set the property corresponding to Lspa.getTlvs() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • addAugmentation

      public LspaBuilder addAugmentation(org.opendaylight.yangtools.binding.Augmentation<Lspa> augmentation)
      Add an augmentation to this builder's product.
      Parameters:
      augmentation - augmentation to be added
      Returns:
      this builder
      Throws:
      NullPointerException - if augmentation is null
    • removeAugmentation

      public LspaBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.binding.Augmentation<Lspa>> augmentationType)
      Remove an augmentation from this builder's product. If this builder does not track such an augmentation type, this method does nothing.
      Parameters:
      augmentationType - augmentation type to be removed
      Returns:
      this builder
    • build

      public @NonNull Lspa build()
      A new Lspa instance.
      Returns:
      A new Lspa instance.