java.lang.Object
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterListBuilder

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

   
     OuterList createOuterList(int fooXyzzy, int barBaz) {
         return new OuterListBuilder()
             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
             .setBar(new BarBuilder().setBaz(barBaz).build())
             .build();
     }
   
 

This pattern is supported by the immutable nature of OuterList, 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 Details

    • OuterListBuilder

      public OuterListBuilder()
      Construct an empty builder.
    • OuterListBuilder

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

    • key

      public OuterListKey key()
      Return current value associated with the property corresponding to OuterList.key().
      Returns:
      current value
    • getId

      public Integer getId()
      Return current value associated with the property corresponding to OuterList.getId().
      Returns:
      current value
    • getInnerList

      public Map<InnerListKey,InnerList> getInnerList()
      Return current value associated with the property corresponding to OuterList.getInnerList().
      Returns:
      current value
    • getOuterChoice

      public OuterChoice getOuterChoice()
      Return current value associated with the property corresponding to OuterList.getOuterChoice().
      Returns:
      current value
    • augmentation

      public <E$$ extends org.opendaylight.yangtools.binding.Augmentation<OuterList>> 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
    • withKey

      public OuterListBuilder withKey(OuterListKey key)
      Set the key value corresponding to OuterList.key() to the specified value.
      Parameters:
      key - desired value
      Returns:
      this builder
    • setId

      public OuterListBuilder setId(Integer value)
      Set the property corresponding to OuterList.getId() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • setInnerList

      public OuterListBuilder setInnerList(Map<InnerListKey,InnerList> values)
      Set the property corresponding to OuterList.getInnerList() to the specified value.
      Parameters:
      values - desired value
      Returns:
      this builder
    • setOuterChoice

      public OuterListBuilder setOuterChoice(OuterChoice value)
      Set the property corresponding to OuterList.getOuterChoice() to the specified value.
      Parameters:
      value - desired value
      Returns:
      this builder
    • addAugmentation

      public OuterListBuilder addAugmentation(org.opendaylight.yangtools.binding.Augmentation<OuterList> 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 OuterListBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.binding.Augmentation<OuterList>> 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 OuterList build()
      A new OuterList instance.
      Returns:
      A new OuterList instance.