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 theclassification
attribute.depositionDate
(Date depositionDate) Initializes the value for thedepositionDate
attribute.from
(PdbHeaderLine instance) Fill a builder with attribute values from the providedPdbHeaderLine
instance.Initializes the value for theidCode
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedPdbHeaderLine
instance. 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:
this
builder for use in a chained invocation
-
classification
Initializes the value for theclassification
attribute.- Parameters:
classification
- The value for classification- Returns:
this
builder for use in a chained invocation
-
depositionDate
Initializes the value for thedepositionDate
attribute.- Parameters:
depositionDate
- The value for depositionDate- Returns:
this
builder for use in a chained invocation
-
idCode
Initializes the value for theidCode
attribute.- Parameters:
idCode
- The value for idCode- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutablePdbHeaderLine
.- Returns:
- An immutable instance of PdbHeaderLine
- Throws:
IllegalStateException
- if any required attributes are missing
-