Package com.io7m.smfj.processing.api
Class SMFFilterCommandModule
- java.lang.Object
-
- com.io7m.smfj.processing.api.SMFFilterCommandModule
-
- All Implemented Interfaces:
SMFFilterCommandModuleType
public final class SMFFilterCommandModule extends java.lang.Object implements SMFFilterCommandModuleType
A module containing filter commands.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SMFFilterCommandModule.Builder
Builds instances of typeSMFFilterCommandModule
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SMFFilterCommandModule.Builder
builder()
Creates a builder forSMFFilterCommandModule
.static SMFFilterCommandModule
copyOf(SMFFilterCommandModuleType instance)
Creates an immutable copy of aSMFFilterCommandModuleType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofSMFFilterCommandModule
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:name
,parsers
.java.lang.String
name()
static SMFFilterCommandModule
of(java.lang.String name, java.util.Map<java.lang.String,? extends SMFFilterCommandParserType> parsers)
Construct a new immutableSMFFilterCommandModule
instance.java.util.Map<java.lang.String,SMFFilterCommandParserType>
parsers()
java.lang.String
toString()
Prints the immutable valueSMFFilterCommandModule
with attribute values.SMFFilterCommandModule
withName(java.lang.String value)
Copy the current immutable object by setting a value for thename
attribute.SMFFilterCommandModule
withParsers(java.util.Map<java.lang.String,? extends SMFFilterCommandParserType> entries)
Copy the current immutable object by replacing theparsers
map with the specified map.
-
-
-
Method Detail
-
name
public java.lang.String name()
- Specified by:
name
in interfaceSMFFilterCommandModuleType
- Returns:
- The module name
-
parsers
public java.util.Map<java.lang.String,SMFFilterCommandParserType> parsers()
- Specified by:
parsers
in interfaceSMFFilterCommandModuleType
- Returns:
- The available command parsers, by name
-
withName
public final SMFFilterCommandModule withName(java.lang.String value)
Copy the current immutable object by setting a value for thename
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for name- Returns:
- A modified copy of the
this
object
-
withParsers
public final SMFFilterCommandModule withParsers(java.util.Map<java.lang.String,? extends SMFFilterCommandParserType> entries)
Copy the current immutable object by replacing theparsers
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the parsers map- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofSMFFilterCommandModule
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()
Computes a hash code from attributes:name
,parsers
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueSMFFilterCommandModule
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static SMFFilterCommandModule of(java.lang.String name, java.util.Map<java.lang.String,? extends SMFFilterCommandParserType> parsers)
Construct a new immutableSMFFilterCommandModule
instance.- Parameters:
name
- The value for thename
attributeparsers
- The value for theparsers
attribute- Returns:
- An immutable SMFFilterCommandModule instance
-
copyOf
public static SMFFilterCommandModule copyOf(SMFFilterCommandModuleType instance)
Creates an immutable copy of aSMFFilterCommandModuleType
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable SMFFilterCommandModule instance
-
builder
public static SMFFilterCommandModule.Builder builder()
Creates a builder forSMFFilterCommandModule
.SMFFilterCommandModule.builder() .setName(String) // required
name
.putParsers|putAllParsers(String => com.io7m.smfj.processing.api.SMFFilterCommandParserType) //parsers
mappings .build();- Returns:
- A new SMFFilterCommandModule builder
-
-