Module gomint.api

Class BlockPositionConverter

  • All Implemented Interfaces:
    Converter

    public class BlockPositionConverter
    extends BaseConverter
    Version:
    1.0
    Author:
    geNAZt
    • Constructor Detail

      • BlockPositionConverter

        public BlockPositionConverter​(InternalConverter internalConverter)
    • Method Detail

      • toConfig

        public Object toConfig​(Class<?> type,
                               Object object,
                               ParameterizedType parameterizedType)
        This method gets called on save. It gets the Fields Type and the object the Config wants to save into it. This is needed to pretty print INTO the config.
        Parameters:
        type - The type (Class) of the Field
        object - The object which is stored in the Config Object
        parameterizedType - If the Class has some generic information this is the information otherwise this is null
        Returns:
        An Object (mostly a Map or a List)
      • fromConfig

        public Object fromConfig​(Class type,
                                 Object object,
                                 ParameterizedType parameterizedType)
        This method gets called when we want to load something out of the File. You get that what you give into the Config via toConfig as Object passed. The type is the Destination Field Type which this Object should be layed in.
        Parameters:
        type - The type (Class) of the Field
        object - The Object from toConfig
        parameterizedType - If the Class has some generic information this is the information otherwise this is null
        Returns:
        The correct Object which can be hold by the Field
      • supports

        public boolean supports​(Class<?> type)
        This checks if this converter can convert the given Class
        Parameters:
        type - The type (Class) of the Field to check
        Returns:
        true if this can convert that otherwise false