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 classSMFFilterCommandModule.BuilderBuilds instances of typeSMFFilterCommandModule.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SMFFilterCommandModule.Builderbuilder()Creates a builder forSMFFilterCommandModule.static SMFFilterCommandModulecopyOf(SMFFilterCommandModuleType instance)Creates an immutable copy of aSMFFilterCommandModuleTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofSMFFilterCommandModulethat have equal attribute values.inthashCode()Computes a hash code from attributes:name,parsers.java.lang.Stringname()static SMFFilterCommandModuleof(java.lang.String name, java.util.Map<java.lang.String,? extends SMFFilterCommandParserType> parsers)Construct a new immutableSMFFilterCommandModuleinstance.java.util.Map<java.lang.String,SMFFilterCommandParserType>parsers()java.lang.StringtoString()Prints the immutable valueSMFFilterCommandModulewith attribute values.SMFFilterCommandModulewithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.SMFFilterCommandModulewithParsers(java.util.Map<java.lang.String,? extends SMFFilterCommandParserType> entries)Copy the current immutable object by replacing theparsersmap with the specified map.
-
-
-
Method Detail
-
name
public java.lang.String name()
- Specified by:
namein interfaceSMFFilterCommandModuleType- Returns:
- The module name
-
parsers
public java.util.Map<java.lang.String,SMFFilterCommandParserType> parsers()
- Specified by:
parsersin 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 thenameattribute. 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
thisobject
-
withParsers
public final SMFFilterCommandModule withParsers(java.util.Map<java.lang.String,? extends SMFFilterCommandParserType> entries)
Copy the current immutable object by replacing theparsersmap 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
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofSMFFilterCommandModulethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,parsers.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueSMFFilterCommandModulewith attribute values.- Overrides:
toStringin 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 immutableSMFFilterCommandModuleinstance.- Parameters:
name- The value for thenameattributeparsers- The value for theparsersattribute- Returns:
- An immutable SMFFilterCommandModule instance
-
copyOf
public static SMFFilterCommandModule copyOf(SMFFilterCommandModuleType instance)
Creates an immutable copy of aSMFFilterCommandModuleTypevalue. 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) // requiredname.putParsers|putAllParsers(String => com.io7m.smfj.processing.api.SMFFilterCommandParserType) //parsersmappings .build();- Returns:
- A new SMFFilterCommandModule builder
-
-