Class SPIParserRequest
java.lang.Object
com.io7m.coffeepick.runtime.parser.spi.SPIParserRequest
- All Implemented Interfaces:
SPIParserRequestType
public final class SPIParserRequest extends java.lang.Object implements SPIParserRequestType
A parser request.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SPIParserRequest.Builder
Builds instances of typeSPIParserRequest
. -
Method Summary
Modifier and Type Method Description static SPIParserRequest.Builder
builder()
Creates a builder forSPIParserRequest
.static SPIParserRequest
copyOf(SPIParserRequestType instance)
Creates an immutable copy of aSPIParserRequestType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofSPIParserRequest
that have equal attribute values.java.net.URI
file()
int
hashCode()
Computes a hash code from attributes:file
,stream
.java.io.InputStream
stream()
java.lang.String
toString()
Prints the immutable valueSPIParserRequest
with attribute values.SPIParserRequest
withFile(java.net.URI value)
Copy the current immutable object by setting a value for thefile
attribute.SPIParserRequest
withStream(java.io.InputStream value)
Copy the current immutable object by setting a value for thestream
attribute.
-
Method Details
-
file
public java.net.URI file()- Specified by:
file
in interfaceSPIParserRequestType
- Returns:
- The URI of the file, for diagnostic purposes
-
stream
public java.io.InputStream stream()- Specified by:
stream
in interfaceSPIParserRequestType
- Returns:
- An open input stream of the file to be parsed
-
withFile
Copy the current immutable object by setting a value for thefile
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for file- Returns:
- A modified copy of the
this
object
-
withStream
Copy the current immutable object by setting a value for thestream
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for stream- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofSPIParserRequest
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:file
,stream
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueSPIParserRequest
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aSPIParserRequestType
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 SPIParserRequest instance
-
builder
Creates a builder forSPIParserRequest
.SPIParserRequest.builder() .setFile(java.net.URI) // required
file
.setStream(java.io.InputStream) // requiredstream
.build();- Returns:
- A new SPIParserRequest builder
-