Class PeripheralType
java.lang.Object
dan200.computercraft.api.peripheral.PeripheralType
The type of a
GenericPeripheral.
When determining the final type of the resulting peripheral, the union of all types is taken, with the lexicographically smallest non-empty name being chosen.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet any additional types or "traits" of this peripheral.@Nullable StringGet the name of this peripheral type.static PeripheralTypeofAdditional(String... additionalTypes) Create a new peripheral type with no primary type but additional traits.static PeripheralTypeofAdditional(Collection<String> additionalTypes) Create a new peripheral type with no primary type but additional traits.static PeripheralTypeCreate a new non-empty peripheral type.static PeripheralTypeCreate a new non-empty peripheral type with additional traits.static PeripheralTypeofType(String type, Collection<String> additionalTypes) Create a new non-empty peripheral type with additional traits.static PeripheralTypeuntyped()An empty peripheral type, used when aGenericPeripheraldoes not have an explicit type.
-
Constructor Details
-
PeripheralType
-
-
Method Details
-
untyped
An empty peripheral type, used when aGenericPeripheraldoes not have an explicit type.- Returns:
- The empty peripheral type.
-
ofType
Create a new non-empty peripheral type.- Parameters:
type- The name of the type.- Returns:
- The constructed peripheral type.
-
ofType
Create a new non-empty peripheral type with additional traits.- Parameters:
type- The name of the type.additionalTypes- Additional types, or "traits" of this peripheral. For instance,"inventory".- Returns:
- The constructed peripheral type.
-
ofType
Create a new non-empty peripheral type with additional traits.- Parameters:
type- The name of the type.additionalTypes- Additional types, or "traits" of this peripheral. For instance,"inventory".- Returns:
- The constructed peripheral type.
-
ofAdditional
Create a new peripheral type with no primary type but additional traits.- Parameters:
additionalTypes- Additional types, or "traits" of this peripheral. For instance,"inventory".- Returns:
- The constructed peripheral type.
-
ofAdditional
Create a new peripheral type with no primary type but additional traits.- Parameters:
additionalTypes- Additional types, or "traits" of this peripheral. For instance,"inventory".- Returns:
- The constructed peripheral type.
-
getPrimaryType
Get the name of this peripheral type. This may benull.- Returns:
- The type of this peripheral.
- See Also:
-
getAdditionalTypes
Get any additional types or "traits" of this peripheral. These effectively act as a standard set of interfaces a peripheral might have.- Returns:
- All additional types.
- See Also:
-