Class SystemBuilder
- java.lang.Object
-
- org.opendaylight.yang.gen.v1.http.openconfig.net.yang.system.rev200413.system.top.SystemBuilder
-
@Generated("mdsal-binding-generator") public class SystemBuilder extends Object
Class that buildsSysteminstances. 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:
System
- 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
-
-
Constructor Summary
Constructors Constructor Description SystemBuilder()Construct 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.SystemBuilder(ProcmonProcessesTop arg)Construct a new builder initialized from specifiedProcmonProcessesTop.SystemBuilder(System base)Construct a builder initialized with state from specifiedSystem.SystemBuilder(SystemClockTop arg)Construct a new builder initialized from specifiedSystemClockTop.SystemBuilder(SystemCpuTop arg)Construct a new builder initialized from specifiedSystemCpuTop.SystemBuilder(SystemDnsTop arg)Construct a new builder initialized from specifiedSystemDnsTop.SystemBuilder(SystemMemoryTop arg)Construct a new builder initialized from specifiedSystemMemoryTop.SystemBuilder(SystemNtpTop arg)Construct a new builder initialized from specifiedSystemNtpTop.SystemBuilder(SystemSshServerTop arg)Construct a new builder initialized from specifiedSystemSshServerTop.SystemBuilder(SystemTelnetServerTop arg)Construct a new builder initialized from specifiedSystemTelnetServerTop.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SystemBuilderaddAugmentation(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.voidfieldsFrom(org.opendaylight.yangtools.yang.binding.DataObject arg)Set fields from given grouping argument.AaagetAaa()Return current value associated with the property corresponding toAaaTop.getAaa().AlarmsgetAlarms()Return current value associated with the property corresponding toAlarmsTop.getAlarms().ClockgetClock()Return current value associated with the property corresponding toSystemClockTop.getClock().ConfiggetConfig()Return current value associated with the property corresponding toSystem.getConfig().CpusgetCpus()Return current value associated with the property corresponding toSystemCpuTop.getCpus().DnsgetDns()Return current value associated with the property corresponding toSystemDnsTop.getDns().LicensegetLicense()Return current value associated with the property corresponding toLicenseTop.getLicense().LogginggetLogging()Return current value associated with the property corresponding toLoggingTop.getLogging().MemorygetMemory()Return current value associated with the property corresponding toSystemMemoryTop.getMemory().MessagesgetMessages()Return current value associated with the property corresponding toMessagesTop.getMessages().NtpgetNtp()Return current value associated with the property corresponding toSystemNtpTop.getNtp().ProcessesgetProcesses()Return current value associated with the property corresponding toProcmonProcessesTop.getProcesses().SshServergetSshServer()Return current value associated with the property corresponding toSystemSshServerTop.getSshServer().StategetState()Return current value associated with the property corresponding toSystem.getState().TelnetServergetTelnetServer()Return current value associated with the property corresponding toSystemTelnetServerTop.getTelnetServer().SystemBuilderremoveAugmentation(Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<System>> augmentationType)Remove an augmentation from this builder's product.SystemBuildersetAaa(Aaa value)Set the property corresponding toAaaTop.getAaa()to the specified value.SystemBuildersetAlarms(Alarms value)Set the property corresponding toAlarmsTop.getAlarms()to the specified value.SystemBuildersetClock(Clock value)Set the property corresponding toSystemClockTop.getClock()to the specified value.SystemBuildersetConfig(Config value)Set the property corresponding toSystem.getConfig()to the specified value.SystemBuildersetCpus(Cpus value)Set the property corresponding toSystemCpuTop.getCpus()to the specified value.SystemBuildersetDns(Dns value)Set the property corresponding toSystemDnsTop.getDns()to the specified value.SystemBuildersetLicense(License value)Set the property corresponding toLicenseTop.getLicense()to the specified value.SystemBuildersetLogging(Logging value)Set the property corresponding toLoggingTop.getLogging()to the specified value.SystemBuildersetMemory(Memory value)Set the property corresponding toSystemMemoryTop.getMemory()to the specified value.SystemBuildersetMessages(Messages value)Set the property corresponding toMessagesTop.getMessages()to the specified value.SystemBuildersetNtp(Ntp value)Set the property corresponding toSystemNtpTop.getNtp()to the specified value.SystemBuildersetProcesses(Processes value)Set the property corresponding toProcmonProcessesTop.getProcesses()to the specified value.SystemBuildersetSshServer(SshServer value)Set the property corresponding toSystemSshServerTop.getSshServer()to the specified value.SystemBuildersetState(State value)Set the property corresponding toSystem.getState()to the specified value.SystemBuildersetTelnetServer(TelnetServer value)Set the property corresponding toSystemTelnetServerTop.getTelnetServer()to the specified value.
-
-
-
Constructor Detail
-
SystemBuilder
public SystemBuilder()
Construct an empty builder.
-
SystemBuilder
public SystemBuilder(SystemClockTop arg)
Construct a new builder initialized from specifiedSystemClockTop.- Parameters:
arg- SystemClockTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(SystemDnsTop arg)
Construct a new builder initialized from specifiedSystemDnsTop.- Parameters:
arg- SystemDnsTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(SystemNtpTop arg)
Construct a new builder initialized from specifiedSystemNtpTop.- Parameters:
arg- SystemNtpTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(SystemSshServerTop arg)
Construct a new builder initialized from specifiedSystemSshServerTop.- Parameters:
arg- SystemSshServerTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(SystemTelnetServerTop arg)
Construct a new builder initialized from specifiedSystemTelnetServerTop.- Parameters:
arg- SystemTelnetServerTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(LoggingTop arg)
Construct a new builder initialized from specifiedLoggingTop.- Parameters:
arg- LoggingTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(AaaTop arg)
Construct a new builder initialized from specifiedAaaTop.- Parameters:
arg- AaaTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(SystemMemoryTop arg)
Construct a new builder initialized from specifiedSystemMemoryTop.- Parameters:
arg- SystemMemoryTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(SystemCpuTop arg)
Construct a new builder initialized from specifiedSystemCpuTop.- Parameters:
arg- SystemCpuTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(ProcmonProcessesTop arg)
Construct a new builder initialized from specifiedProcmonProcessesTop.- Parameters:
arg- ProcmonProcessesTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(AlarmsTop arg)
Construct a new builder initialized from specifiedAlarmsTop.- Parameters:
arg- AlarmsTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(MessagesTop arg)
Construct a new builder initialized from specifiedMessagesTop.- Parameters:
arg- MessagesTop from which the builder should be initialized
-
SystemBuilder
public SystemBuilder(LicenseTop arg)
Construct a new builder initialized from specifiedLicenseTop.- Parameters:
arg- LicenseTop from which the builder should be initialized
-
-
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:- Parameters:
arg- grouping object- Throws:
IllegalArgumentException- if given argument is none of valid types or has property with incompatible value
-
getAaa
public Aaa getAaa()
Return current value associated with the property corresponding toAaaTop.getAaa().- Returns:
- current value
-
getAlarms
public Alarms getAlarms()
Return current value associated with the property corresponding toAlarmsTop.getAlarms().- Returns:
- current value
-
getClock
public Clock getClock()
Return current value associated with the property corresponding toSystemClockTop.getClock().- Returns:
- current value
-
getConfig
public Config getConfig()
Return current value associated with the property corresponding toSystem.getConfig().- Returns:
- current value
-
getCpus
public Cpus getCpus()
Return current value associated with the property corresponding toSystemCpuTop.getCpus().- Returns:
- current value
-
getDns
public Dns getDns()
Return current value associated with the property corresponding toSystemDnsTop.getDns().- Returns:
- current value
-
getLicense
public License getLicense()
Return current value associated with the property corresponding toLicenseTop.getLicense().- Returns:
- current value
-
getLogging
public Logging getLogging()
Return current value associated with the property corresponding toLoggingTop.getLogging().- Returns:
- current value
-
getMemory
public Memory getMemory()
Return current value associated with the property corresponding toSystemMemoryTop.getMemory().- Returns:
- current value
-
getMessages
public Messages getMessages()
Return current value associated with the property corresponding toMessagesTop.getMessages().- Returns:
- current value
-
getNtp
public Ntp getNtp()
Return current value associated with the property corresponding toSystemNtpTop.getNtp().- Returns:
- current value
-
getProcesses
public Processes getProcesses()
Return current value associated with the property corresponding toProcmonProcessesTop.getProcesses().- Returns:
- current value
-
getSshServer
public SshServer getSshServer()
Return current value associated with the property corresponding toSystemSshServerTop.getSshServer().- Returns:
- current value
-
getState
public State getState()
Return current value associated with the property corresponding toSystem.getState().- Returns:
- current value
-
getTelnetServer
public TelnetServer 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
public SystemBuilder setAaa(Aaa value)
Set the property corresponding toAaaTop.getAaa()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setAlarms
public SystemBuilder setAlarms(Alarms value)
Set the property corresponding toAlarmsTop.getAlarms()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setClock
public SystemBuilder setClock(Clock value)
Set the property corresponding toSystemClockTop.getClock()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setConfig
public SystemBuilder setConfig(Config value)
Set the property corresponding toSystem.getConfig()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setCpus
public SystemBuilder setCpus(Cpus value)
Set the property corresponding toSystemCpuTop.getCpus()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setDns
public SystemBuilder setDns(Dns value)
Set the property corresponding toSystemDnsTop.getDns()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setLicense
public SystemBuilder setLicense(License value)
Set the property corresponding toLicenseTop.getLicense()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setLogging
public SystemBuilder setLogging(Logging value)
Set the property corresponding toLoggingTop.getLogging()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setMemory
public SystemBuilder setMemory(Memory value)
Set the property corresponding toSystemMemoryTop.getMemory()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setMessages
public SystemBuilder setMessages(Messages value)
Set the property corresponding toMessagesTop.getMessages()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setNtp
public SystemBuilder setNtp(Ntp value)
Set the property corresponding toSystemNtpTop.getNtp()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setProcesses
public SystemBuilder setProcesses(Processes value)
Set the property corresponding toProcmonProcessesTop.getProcesses()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setSshServer
public SystemBuilder setSshServer(SshServer value)
Set the property corresponding toSystemSshServerTop.getSshServer()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setState
public SystemBuilder setState(State value)
Set the property corresponding toSystem.getState()to the specified value.- Parameters:
value- desired value- Returns:
- this builder
-
setTelnetServer
public SystemBuilder setTelnetServer(TelnetServer value)
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
-
-