Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 2.51 KB

File metadata and controls

91 lines (63 loc) · 2.51 KB

Setup

Getting dependency

Import the latest version with Maven using JitPack.
(Check JitPack Enterprise for use in private repositories)

General use

  1. Non-static use:
    • Add FileHandler object to your preferred class.
      Multiple FileHandler objects with different values possible.
    • Use fileHandler.text for reading/writing text files.
      (EncodingType enum available at EncodingUtilities class.)
    • Use fileHandler.image for reading images.
  2. Static use:
    • TextConversion class.

Importable/exportable data types

Primitives

Simple data types that extend IEPrimitive class:

  • boolean
  • int
  • float
  • double
  • string

Usage:

  • Use getValue() to get its value.
  • Check if provided string matches key by boolean compareKey(String key).
  • Set value:
    • from imported value array by parseStringArrayToValue(String[] valueArray),
    • manually by setValue(T value).
  • Prepare for exporting:
    • only value array: String[] parseValueToStringArray(),
    • full separated line: String[] combineKeyAndValue().
  • Miscellaneous:
    • reset value: resetValue(),
    • gat value array from separated line: String[] separateValue(String[] line).

Arrays

  • boolean array
  • int array
  • float array
  • double array
  • string array

Usage: same as primitives

Special

* color (not tested)

Usage: same as primitives

IE list (not ready yet)

A list for containing AbstractImportableExportable objects.

Usage:

  • Refer to list parameter to get actual ArrayList of AbstractImportableExportable.
  • Call ArrayList<String[]> exportLines() to get its members prepared for exporting.
  • Set from imported lines by importLines(ArrayList<String[]> importableLines).

Custom IE object

  1. Extend AbstractImportableExportable class.
  2. Add desired value parameter.
  3. Add unimplemented methods from ImportableExportableInterface:
    • String[] valueArray() - Parse value parameter to String[].
    • void setValue(String[] valueArray) - Parse String[] to parameter value.
  4. Add constructor from super and add value as parameter.

Usage:

  • Refer to value parameter to get its value.
  • Check if provided string matches key by boolean compareKey(String key).
  • Set from imported lines by importLine(String[] importableLine).
  • Call String[] exportLine() to get its key and value prepared for exporting.

Adapters

Coming soon...