Class Sharable.Builder<T>
java.lang.Object
org.mvplugins.multiverse.inventories.share.Sharable.Builder<T>
- Type Parameters:
T
- The type of data the new Sharable will represent.
This class is used to build new
Sharable
s. Simply instantiate this and use method chaining to set
all the options for your Sharable.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
defaultSerializer
(ProfileEntry entry) This will make the Sharable use the default serializer which simply passes the data as is to the persistence object for persistence.optional()
Indicates that the new Sharable is optional as described inSharable.isOptional()
.serializer
(ProfileEntry entry, SharableSerializer<T> serializer) This allows you to specify a customSharableSerializer
to use to convert the data represented by this Sharable into something acceptable by persistence.stringSerializer
(ProfileEntry entry) Sets this sharable to be serialized as a string in the profile data file.
-
Constructor Details
-
Method Details
-
optional
Indicates that the new Sharable is optional as described inSharable.isOptional()
.- Returns:
- This builder object for method chaining.
-
altName
- Parameters:
name
- An alternate name for this Sharable which can be used to indicate a group is sharing this Sharable.- Returns:
- This builder object for method chaining.
-
build
- Returns:
- The new Sharable object built by this Builder.
-