Package io.thestencil.staticontent.api
Class ImmutableLinkData.Builder
- java.lang.Object
-
- io.thestencil.staticontent.api.ImmutableLinkData.Builder
-
- Enclosing class:
- ImmutableLinkData
@NotThreadSafe public static final class ImmutableLinkData.Builder extends Object
Builds instances of typeImmutableLinkData. 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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableLinkDatabuild()Builds a newImmutableLinkData.ImmutableLinkData.Builderfrom(StaticContentClient.LinkData instance)Fill a builder with attribute values from the providedLinkDatainstance.ImmutableLinkData.Builderid(String id)Initializes the value for theidattribute.ImmutableLinkData.Builderlocale(String locale)Initializes the value for thelocaleattribute.ImmutableLinkData.Buildername(String name)Initializes the value for thenameattribute.ImmutableLinkData.Builderpath(String path)Initializes the value for thepathattribute.ImmutableLinkData.Buildertype(String type)Initializes the value for thetypeattribute.ImmutableLinkData.Buildervalue(String value)Initializes the value for thevalueattribute.ImmutableLinkData.Builderworkflow(Boolean workflow)Initializes the value for theworkflowattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableLinkData.Builder from(StaticContentClient.LinkData instance)
Fill a builder with attribute values from the providedLinkDatainstance. 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
-
id
@CanIgnoreReturnValue public final ImmutableLinkData.Builder id(String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
path
@CanIgnoreReturnValue public final ImmutableLinkData.Builder path(String path)
Initializes the value for thepathattribute.- Parameters:
path- The value for path- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableLinkData.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
type
@CanIgnoreReturnValue public final ImmutableLinkData.Builder type(String type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
value
@CanIgnoreReturnValue public final ImmutableLinkData.Builder value(String value)
Initializes the value for thevalueattribute.- Parameters:
value- The value for value- Returns:
thisbuilder for use in a chained invocation
-
locale
@CanIgnoreReturnValue public final ImmutableLinkData.Builder locale(String locale)
Initializes the value for thelocaleattribute.- Parameters:
locale- The value for locale- Returns:
thisbuilder for use in a chained invocation
-
workflow
@CanIgnoreReturnValue public final ImmutableLinkData.Builder workflow(Boolean workflow)
Initializes the value for theworkflowattribute.- Parameters:
workflow- The value for workflow- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableLinkData build()
Builds a newImmutableLinkData.- Returns:
- An immutable instance of LinkData
- Throws:
IllegalStateException- if any required attributes are missing
-
-