Package com.io7m.jnoisetype.api
Class NTSource.Builder
java.lang.Object
com.io7m.jnoisetype.api.NTSource.Builder
- Enclosing class:
- NTSource
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newNTSource.final NTSource.Builderfrom(NTSourceType instance) Fill a builder with attribute values from the providedNTSourceTypeinstance.final NTSource.BuildersetOffset(long offset) Initializes the value for theoffsetattribute.final NTSource.BuilderInitializes the value for thesourceattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedNTSourceTypeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setSource
Initializes the value for thesourceattribute.- Parameters:
source- The value for source- Returns:
thisbuilder for use in a chained invocation
-
setOffset
Initializes the value for theoffsetattribute.- Parameters:
offset- The value for offset- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newNTSource.- Returns:
- An immutable instance of NTSource
- Throws:
IllegalStateException- if any required attributes are missing
-