Package pl.poznan.put.pdb
Class ImmutablePdbHeaderLine.Builder
java.lang.Object
pl.poznan.put.pdb.ImmutablePdbHeaderLine.Builder
- Enclosing class:
- ImmutablePdbHeaderLine
Builds instances of type
ImmutablePdbHeaderLine.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutablePdbHeaderLine.classification(String classification) Initializes the value for theclassificationattribute.depositionDate(Date depositionDate) Initializes the value for thedepositionDateattribute.from(PdbHeaderLine instance) Fill a builder with attribute values from the providedPdbHeaderLineinstance.Initializes the value for theidCodeattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedPdbHeaderLineinstance. 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
-
classification
Initializes the value for theclassificationattribute.- Parameters:
classification- The value for classification- Returns:
thisbuilder for use in a chained invocation
-
depositionDate
Initializes the value for thedepositionDateattribute.- Parameters:
depositionDate- The value for depositionDate- Returns:
thisbuilder for use in a chained invocation
-
idCode
Initializes the value for theidCodeattribute.- Parameters:
idCode- The value for idCode- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutablePdbHeaderLine.- Returns:
- An immutable instance of PdbHeaderLine
- Throws:
IllegalStateException- if any required attributes are missing
-