Class SystemBuilder
java.lang.Object
org.opendaylight.yang.gen.v1.http.openconfig.net.yang.system.rev200413.system.top.SystemBuilder
Class that builds
System 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:
System createSystem(int fooXyzzy, int barBaz) {
return new SystemBuilder()
.setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
.setBar(new BarBuilder().setBaz(barBaz).build())
.build();
}
This pattern is supported by the immutable nature of System, 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
ConstructorsConstructorDescriptionConstruct an empty builder.SystemBuilder(AaaTop arg) Construct a new builder initialized from specifiedAaaTop.SystemBuilder(AlarmsTop arg) Construct a new builder initialized from specifiedAlarmsTop.SystemBuilder(LicenseTop arg) Construct a new builder initialized from specifiedLicenseTop.SystemBuilder(MessagesTop arg) Construct a new builder initialized from specifiedMessagesTop.SystemBuilder(LoggingTop arg) Construct a new builder initialized from specifiedLoggingTop.Construct a new builder initialized from specifiedProcmonProcessesTop.SystemBuilder(System base) Construct a builder initialized with state from specifiedSystem.Construct a new builder initialized from specifiedSystemClockTop.Construct a new builder initialized from specifiedSystemCpuTop.Construct a new builder initialized from specifiedSystemDnsTop.Construct a new builder initialized from specifiedSystemMemoryTop.Construct a new builder initialized from specifiedSystemNtpTop.Construct a new builder initialized from specifiedSystemSshServerTop.Construct a new builder initialized from specifiedSystemTelnetServerTop. -
Method Summary
Modifier and TypeMethodDescriptionaddAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<System> augmentation) Add an augmentation to this builder's product.<E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<System>>
E$$augmentation(Class<E$$> augmentationType) Return the specified augmentation, if it is present in this builder.@NonNull Systembuild()A newSysteminstance.static @NonNull Systemempty()Get empty instance of System.voidfieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg) Set fields from given grouping argument.getAaa()Return current value associated with the property corresponding toAaaTop.getAaa().Return current value associated with the property corresponding toAlarmsTop.getAlarms().getClock()Return current value associated with the property corresponding toSystemClockTop.getClock().Return current value associated with the property corresponding toSystem.getConfig().getCpus()Return current value associated with the property corresponding toSystemCpuTop.getCpus().getDns()Return current value associated with the property corresponding toSystemDnsTop.getDns().Return current value associated with the property corresponding toLicenseTop.getLicense().Return current value associated with the property corresponding toLoggingTop.getLogging().Return current value associated with the property corresponding toSystemMemoryTop.getMemory().Return current value associated with the property corresponding toMessagesTop.getMessages().getNtp()Return current value associated with the property corresponding toSystemNtpTop.getNtp().Return current value associated with the property corresponding toProcmonProcessesTop.getProcesses().Return current value associated with the property corresponding toSystemSshServerTop.getSshServer().getState()Return current value associated with the property corresponding toSystem.getState().Return current value associated with the property corresponding toSystemTelnetServerTop.getTelnetServer().removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<System>> augmentationType) Remove an augmentation from this builder's product.Set the property corresponding toAaaTop.getAaa()to the specified value.Set the property corresponding toAlarmsTop.getAlarms()to the specified value.Set the property corresponding toSystemClockTop.getClock()to the specified value.Set the property corresponding toSystem.getConfig()to the specified value.Set the property corresponding toSystemCpuTop.getCpus()to the specified value.Set the property corresponding toSystemDnsTop.getDns()to the specified value.setLicense(License value) Set the property corresponding toLicenseTop.getLicense()to the specified value.setLogging(Logging value) Set the property corresponding toLoggingTop.getLogging()to the specified value.Set the property corresponding toSystemMemoryTop.getMemory()to the specified value.setMessages(Messages value) Set the property corresponding toMessagesTop.getMessages()to the specified value.Set the property corresponding toSystemNtpTop.getNtp()to the specified value.setProcesses(Processes value) Set the property corresponding toProcmonProcessesTop.getProcesses()to the specified value.setSshServer(SshServer value) Set the property corresponding toSystemSshServerTop.getSshServer()to the specified value.Set the property corresponding toSystem.getState()to the specified value.setTelnetServer(TelnetServer value) Set the property corresponding toSystemTelnetServerTop.getTelnetServer()to the specified value.
-
Constructor Details
-
SystemBuilder
public SystemBuilder()Construct an empty builder. -
SystemBuilder
Construct a new builder initialized from specifiedSystemClockTop.- Parameters:
arg- SystemClockTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedSystemDnsTop.- Parameters:
arg- SystemDnsTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedSystemNtpTop.- Parameters:
arg- SystemNtpTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedSystemSshServerTop.- Parameters:
arg- SystemSshServerTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedSystemTelnetServerTop.- Parameters:
arg- SystemTelnetServerTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedLoggingTop.- Parameters:
arg- LoggingTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedAaaTop.- Parameters:
arg- AaaTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedSystemMemoryTop.- Parameters:
arg- SystemMemoryTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedSystemCpuTop.- Parameters:
arg- SystemCpuTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedProcmonProcessesTop.- Parameters:
arg- ProcmonProcessesTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedAlarmsTop.- Parameters:
arg- AlarmsTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedMessagesTop.- Parameters:
arg- MessagesTop from which the builder should be initialized
-
SystemBuilder
Construct a new builder initialized from specifiedLicenseTop.- Parameters:
arg- LicenseTop from which the builder should be initialized
-
SystemBuilder
Construct a builder initialized with state from specifiedSystem.- Parameters:
base- System from which the builder should be initialized
-
-
Method Details
-
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:- Parameters:
arg- grouping object- Throws:
IllegalArgumentException- if given argument is none of valid types or has property with incompatible value
-
empty
Get empty instance of System.- Returns:
- An empty
System
-
getAaa
Return current value associated with the property corresponding toAaaTop.getAaa().- Returns:
- current value
-
getAlarms
Return current value associated with the property corresponding toAlarmsTop.getAlarms().- Returns:
- current value
-
getClock
Return current value associated with the property corresponding toSystemClockTop.getClock().- Returns:
- current value
-
getConfig
Return current value associated with the property corresponding toSystem.getConfig().- Returns:
- current value
-
getCpus
Return current value associated with the property corresponding toSystemCpuTop.getCpus().- Returns:
- current value
-
getDns
Return current value associated with the property corresponding toSystemDnsTop.getDns().- Returns:
- current value
-
getLicense
Return current value associated with the property corresponding toLicenseTop.getLicense().- Returns:
- current value
-
getLogging
Return current value associated with the property corresponding toLoggingTop.getLogging().- Returns:
- current value
-
getMemory
Return current value associated with the property corresponding toSystemMemoryTop.getMemory().- Returns:
- current value
-
getMessages
Return current value associated with the property corresponding toMessagesTop.getMessages().- Returns:
- current value
-
getNtp
Return current value associated with the property corresponding toSystemNtpTop.getNtp().- Returns:
- current value
-
getProcesses
Return current value associated with the property corresponding toProcmonProcessesTop.getProcesses().- Returns:
- current value
-
getSshServer
Return current value associated with the property corresponding toSystemSshServerTop.getSshServer().- Returns:
- current value
-
getState
Return current value associated with the property corresponding toSystem.getState().- Returns:
- current value
-
getTelnetServer
Return current value associated with the property corresponding toSystemTelnetServerTop.getTelnetServer().- Returns:
- current value
-
augmentation
public <E$$ extends org.opendaylight.yangtools.yang.binding.Augmentation<System>> 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
nullif not present - Throws:
NullPointerException- ifaugmentTypeisnull
-
setAaa
Set the property corresponding toAaaTop.getAaa()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setAlarms
Set the property corresponding toAlarmsTop.getAlarms()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setClock
Set the property corresponding toSystemClockTop.getClock()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setConfig
Set the property corresponding toSystem.getConfig()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setCpus
Set the property corresponding toSystemCpuTop.getCpus()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setDns
Set the property corresponding toSystemDnsTop.getDns()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setLicense
Set the property corresponding toLicenseTop.getLicense()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setLogging
Set the property corresponding toLoggingTop.getLogging()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setMemory
Set the property corresponding toSystemMemoryTop.getMemory()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setMessages
Set the property corresponding toMessagesTop.getMessages()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setNtp
Set the property corresponding toSystemNtpTop.getNtp()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setProcesses
Set the property corresponding toProcmonProcessesTop.getProcesses()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setSshServer
Set the property corresponding toSystemSshServerTop.getSshServer()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setState
Set the property corresponding toSystem.getState()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setTelnetServer
Set the property corresponding toSystemTelnetServerTop.getTelnetServer()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
addAugmentation
public SystemBuilder addAugmentation(org.opendaylight.yangtools.yang.binding.Augmentation<System> augmentation) Add an augmentation to this builder's product.- Parameters:
augmentation- augmentation to be added- Returns:
- this builder
- Throws:
NullPointerException- ifaugmentationis null
-
removeAugmentation
public SystemBuilder removeAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<System>> 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
A newSysteminstance.- Returns:
- A new
Systeminstance.
-