Class XrefPropertyValue.Builder
- java.lang.Object
-
- org.geneontology.obographs.core.model.meta.XrefPropertyValue.Builder
-
- Enclosing class:
- XrefPropertyValue
@NotThreadSafe public static final class XrefPropertyValue.Builder extends Object
Builds instances of typeXrefPropertyValue. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Creates a builder forXrefPropertyValueinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XrefPropertyValue.BuilderaddAllXrefs(Iterable<String> elements)Adds elements toxrefslist.XrefPropertyValue.BuilderaddXref(String element)Adds one element toxrefslist.XrefPropertyValue.BuilderaddXrefs(String... elements)Adds elements toxrefslist.XrefPropertyValuebuild()Builds a newXrefPropertyValue.XrefPropertyValue.Builderfrom(AbstractXrefPropertyValue instance)Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.meta.AbstractXrefPropertyValueinstance.XrefPropertyValue.Builderfrom(PropertyValue instance)Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.meta.PropertyValueinstance.XrefPropertyValue.Builderlbl(String lbl)Initializes the value for thelblattribute.XrefPropertyValue.Buildermeta(Meta meta)Initializes the value for themetaattribute.XrefPropertyValue.Builderpred(String pred)Initializes the value for thepredattribute.XrefPropertyValue.Builderval(String val)Initializes the value for thevalattribute.XrefPropertyValue.Builderxrefs(Iterable<String> elements)Sets or replaces all elements forxrefslist.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forXrefPropertyValueinstances.new XrefPropertyValue.Builder() .pred(String) // optionalpred.val(String) // optionalval.addXref|addAllXrefs(String) //xrefselements .meta(org.geneontology.obographs.core.model.Meta | null) // nullablemeta.lbl(String) // optionallbl.build();
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final XrefPropertyValue.Builder from(AbstractXrefPropertyValue instance)
Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.meta.AbstractXrefPropertyValueinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final XrefPropertyValue.Builder from(PropertyValue instance)
Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.meta.PropertyValueinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
pred
@CanIgnoreReturnValue public final XrefPropertyValue.Builder pred(String pred)
Initializes the value for thepredattribute.If not set, this attribute will have a default value as returned by the initializer of
pred.- Parameters:
pred- The value for pred- Returns:
thisbuilder for use in a chained invocation
-
val
@CanIgnoreReturnValue public final XrefPropertyValue.Builder val(String val)
Initializes the value for thevalattribute.If not set, this attribute will have a default value as returned by the initializer of
val.- Parameters:
val- The value for val- Returns:
thisbuilder for use in a chained invocation
-
addXref
@CanIgnoreReturnValue public final XrefPropertyValue.Builder addXref(String element)
Adds one element toxrefslist.- Parameters:
element- A xrefs element- Returns:
thisbuilder for use in a chained invocation
-
addXrefs
@CanIgnoreReturnValue public final XrefPropertyValue.Builder addXrefs(String... elements)
Adds elements toxrefslist.- Parameters:
elements- An array of xrefs elements- Returns:
thisbuilder for use in a chained invocation
-
xrefs
@CanIgnoreReturnValue public final XrefPropertyValue.Builder xrefs(Iterable<String> elements)
Sets or replaces all elements forxrefslist.- Parameters:
elements- An iterable of xrefs elements- Returns:
thisbuilder for use in a chained invocation
-
addAllXrefs
@CanIgnoreReturnValue public final XrefPropertyValue.Builder addAllXrefs(Iterable<String> elements)
Adds elements toxrefslist.- Parameters:
elements- An iterable of xrefs elements- Returns:
thisbuilder for use in a chained invocation
-
meta
@CanIgnoreReturnValue public final XrefPropertyValue.Builder meta(@Nullable Meta meta)
Initializes the value for themetaattribute.- Parameters:
meta- The value for meta (can benull)- Returns:
thisbuilder for use in a chained invocation
-
lbl
@CanIgnoreReturnValue public final XrefPropertyValue.Builder lbl(String lbl)
Initializes the value for thelblattribute.If not set, this attribute will have a default value as returned by the initializer of
lbl.- Parameters:
lbl- The value for lbl- Returns:
thisbuilder for use in a chained invocation
-
build
public XrefPropertyValue build()
Builds a newXrefPropertyValue.- Returns:
- An immutable instance of XrefPropertyValue
- Throws:
IllegalStateException- if any required attributes are missing
-
-