public class PayloadBuilder extends Object implements org.opendaylight.yangtools.concepts.Builder<Payload>
PayloadBuilder
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:
PayloadBuilder createTarget(int fooXyzzy, int barBaz) {
return new PayloadBuilderBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of PayloadBuilder, as instances can be freely passed around without worrying about synchronization issues.
As a side note: method chaining results in:
build()
, which is then returned from the methodPayloadBuilder
,
Builder
Constructor and Description |
---|
PayloadBuilder() |
PayloadBuilder(Payload base) |
Modifier and Type | Method and Description |
---|---|
PayloadBuilder |
addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Payload>> augmentationType,
org.opendaylight.yangtools.yang.binding.Augmentation<Payload> augmentationValue) |
<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Payload>> |
augmentation(Class<E$$> augmentationType) |
Payload |
build() |
Integer |
getId() |
PayloadKey |
key() |
PayloadBuilder |
removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Payload>> augmentationType) |
PayloadBuilder |
setId(Integer value) |
PayloadBuilder |
withKey(PayloadKey key) |
public PayloadBuilder()
public PayloadBuilder(Payload base)
public PayloadKey key()
public Integer getId()
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<Payload>> E$$ augmentation(Class<E$$> augmentationType)
public PayloadBuilder withKey(PayloadKey key)
public PayloadBuilder setId(Integer value)
public PayloadBuilder addAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Payload>> augmentationType, org.opendaylight.yangtools.yang.binding.Augmentation<Payload> augmentationValue)
public PayloadBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<Payload>> augmentationType)
public Payload build()
build
in interface org.opendaylight.yangtools.concepts.CheckedBuilder<Payload,IllegalArgumentException>
Copyright © 2019 OpenDaylight. All rights reserved.