Package com.io7m.jnoisetype.api
Class NTSource.Builder
java.lang.Object
com.io7m.jnoisetype.api.NTSource.Builder
- Enclosing class:
- NTSource
public static final class NTSource.Builder
extends java.lang.Object
-
Method Summary
Modifier and Type Method Description NTSourcebuild()Builds a newNTSource.NTSource.Builderfrom(NTSourceType instance)Fill a builder with attribute values from the providedNTSourceTypeinstance.NTSource.BuildersetOffset(long offset)Initializes the value for theoffsetattribute.NTSource.BuildersetSource(java.net.URI source)Initializes the value for thesourceattribute.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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:
java.lang.IllegalStateException- if any required attributes are missing
-