IoItems

Framework Components [com.onepg.util]

← Back to Class List

Class Information

Package: com.onepg.util

Class Name: IoItems

Extends: AbstractIoTypeMap

Description

Input/output items map class.
  • A map class that provides value retrieval methods and value storage methods for each type.
  • Internally stores values as strings.
  • Preserves the storage order of values.
  • Provides versatility by extending Map<String, String>.
  • Can be made read-only by specifying a constructor argument.
  • Basic rules and restrictions:
    • Characters that can be used as keys are limited to lowercase letters, numbers, underscores, hyphens, and dots only.
      (Only characters that can be used in JSON, and letters are unified to lowercase to eliminate DBMS differences)
    • In principle, value retrieval methods do not return null.
    • If you want to retrieve null, use an explicit method such as #getStringNullable(String).
    • In principle, value retrieval with a non-existent key results in a runtime error.
    • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object), or retrieve using an explicit method such as #getStringOrDefault(String, String) that specifies a return value for non-existent keys.
    • Storing with an already existing key results in a runtime error.
    • When storing a value with a key that may already exist, use an explicit method such as #putForce(String, String).
    • When explicitly storing null, use an explicit method such as #putNull(String).
    • Unlike normal maps, the results of #keySet(), #entrySet(), and #values() are read-only.
      (Keys are managed separately internally, and removal from the results would break consistency)
    • Timestamps are stored with up to 6 decimal places.

  • Supports CSV input and output.
  • Supports JSON input and output.
  • Supports URL parameter input and output.
  • Follows the basic rules and restrictions of AbstractIoTypeMap.

Method List

getString (Inherited Method)

public String getString(String key)
Retrieves a string.
  • Retrieving a value with a non-existent key results in a runtime error.
  • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object).
  • If the stored value is null, returns an empty string. (Does not return null)
  • If you want to retrieve null, retrieve using #getStringNullable(String).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

String - the string

getStringOrDefault (Inherited Method)

public String getStringOrDefault(String key, String notExistsValue)
Retrieves a string.
  • If the key does not exist, the non-existent return value from the argument is returned.
  • If the stored value is null, returns an empty string. (Does not return null)
  • If you want to retrieve null, retrieve using #getStringNullableOrDefault(String, String).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
notExistsValue String the return value when the key does not exist

Return Value

String - the string

getStringNullable (Inherited Method)

public String getStringNullable(String key)
Retrieves a string (nullable).
  • Retrieving a value with a non-existent key results in a runtime error.
  • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

String - the string (nullable)

getStringNullableOrDefault (Inherited Method)

public String getStringNullableOrDefault(String key, String notExistsValue)
Retrieves a string (nullable).
  • If the key does not exist, the non-existent return value from the argument is returned.

Parameters

Name Type Description
key String the key
notExistsValue String the return value when the key does not exist

Return Value

String - the string (nullable)

getBigDecimal (Inherited Method)

public BigDecimal getBigDecimal(String key)
Retrieves a numeric value.
  • Retrieving a value with a non-existent key results in a runtime error.
  • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object).
  • If the stored value is null, returns zero. (Does not return null)
  • If you want to retrieve null, retrieve using #getBigDecimalNullable(String).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

BigDecimal - the numeric value

getBigDecimalOrDefault (Inherited Method)

public BigDecimal getBigDecimalOrDefault(String key, BigDecimal notExistsValue)
Retrieves a numeric value.
  • If the key does not exist, the non-existent return value from the argument is returned.
  • If the stored value is null, returns zero. (Does not return null)
  • If you want to retrieve null, retrieve using #getBigDecimalNullableOrDefault(String).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
notExistsValue BigDecimal the return value when the key does not exist

Return Value

BigDecimal - the numeric value

getBigDecimalNullable (Inherited Method)

public BigDecimal getBigDecimalNullable(String key)
Retrieves a numeric value (nullable).
  • Retrieving a value with a non-existent key results in a runtime error.
  • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

BigDecimal - the numeric value (nullable)

getBigDecimalNullableOrDefault (Inherited Method)

public BigDecimal getBigDecimalNullableOrDefault(String key, BigDecimal notExistsValue)
Retrieves a numeric value (nullable).
  • If the key does not exist, the non-existent return value from the argument is returned.

Parameters

Name Type Description
key String the key
notExistsValue BigDecimal the return value when the key does not exist

Return Value

BigDecimal - the numeric value (nullable)

getInt (Inherited Method)

public int getInt(String key)
Retrieves an int value.
  • Retrieving a value with a non-existent key results in a runtime error.
  • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object).
  • If the stored value is null, returns zero.
  • If the value is outside the int range, throws an exception error.

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

int - the int value

getIntOrDefault (Inherited Method)

public int getIntOrDefault(String key, int notExistsValue)
Retrieves an int value.
  • If the key does not exist, the non-existent return value from the argument is returned.
  • If the stored value is null, returns zero.
  • If the value is outside the int range, throws an exception error.

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
notExistsValue int the return value when the key does not exist

Return Value

int - the int value

getLong (Inherited Method)

public long getLong(String key)
Retrieves a long value.
  • Retrieving a value with a non-existent key results in a runtime error.
  • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object).
  • If the stored value is null, returns zero.
  • If the value is outside the long range, throws an exception error.

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

long - the long value

getLongOrDefault (Inherited Method)

public long getLongOrDefault(String key, long notExistsValue)
Retrieves a long value.
  • If the key does not exist, the non-existent return value from the argument is returned.
  • If the stored value is null, returns zero.
  • If the value is outside the long range, throws an exception error.

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
notExistsValue long the return value when the key does not exist

Return Value

long - the long value

getDateNullable (Inherited Method)

public LocalDate getDateNullable(String key)
Retrieves a date (nullable).
  • Retrieving a value with a non-existent key results in a runtime error.
  • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object).
  • If date conversion fails, throws an exception error.

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

LocalDate - the date (nullable)

getDateNullableOrDefault (Inherited Method)

public LocalDate getDateNullableOrDefault(String key, LocalDate notExistsValue)
Retrieves a date (nullable).
  • If the key does not exist, the non-existent return value from the argument is returned.
  • If date conversion fails, throws an exception error.

Parameters

Name Type Description
key String the key
notExistsValue LocalDate the return value when the key does not exist

Return Value

LocalDate - the date (nullable)

getDateTimeNullable (Inherited Method)

public LocalDateTime getDateTimeNullable(String key)
Retrieves a date-time (nullable).
  • Retrieving a value with a non-existent key results in a runtime error.
  • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object).
  • If date-time conversion fails, throws an exception error.

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

LocalDateTime - the date-time (nullable)

getDateTimeNullableOrDefault (Inherited Method)

public LocalDateTime getDateTimeNullableOrDefault(String key, LocalDateTime notExistsValue)
Retrieves a date-time (nullable).
  • If the key does not exist, the non-existent return value from the argument is returned.
  • If date-time conversion fails, throws an exception error.

Parameters

Name Type Description
key String the key
notExistsValue LocalDateTime the return value when the key does not exist

Return Value

LocalDateTime - the date-time (nullable)

getBoolean (Inherited Method)

public boolean getBoolean(String key)
Retrieves a boolean value.
  • Retrieving a value with a non-existent key results in a runtime error.
  • When retrieving a value with a key that may not exist, check existence in advance using #containsKey(Object).
  • Boolean value evaluation conforms to ValUtil.isTrue(String).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

boolean - the boolean value

getBooleanOrDefault (Inherited Method)

public boolean getBooleanOrDefault(String key, boolean notExistsValue)
Retrieves a boolean value.
  • If the key does not exist, the non-existent return value from the argument is returned.
  • Value evaluation conforms to ValUtil.isTrue(String).

Parameters

Name Type Description
key String the key
notExistsValue boolean the return value when the key does not exist

Return Value

boolean - the boolean value

putNull (Inherited Method)

public String putNull(String key)
Stores null.

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

String - the previously stored string

putNullForce (Inherited Method)

public String putNullForce(String key)
Stores null (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

String - the previously stored string

put (Inherited Method)

public String put(String key, String value)
Stores a string.
  • Storing with an already existing key results in a runtime error.
  • When storing a value with a key that may already exist, store using #putForce(String, String).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value String the value

Return Value

String - the previously stored string

put (Inherited Method)

public String put(String key, BigDecimal value)
Stores a numeric value.
  • Storing with an already existing key results in a runtime error.
  • When storing a value with a key that may already exist, store using #putForce(String, BigDecimal).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value BigDecimal the numeric value

Return Value

String - the previously stored string

put (Inherited Method)

public String put(String key, int value)
Stores an int value.
  • Storing with an already existing key results in a runtime error.
  • When storing a value with a key that may already exist, store using #putForce(String, int).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value int the int value

Return Value

String - the previously stored string

put (Inherited Method)

public String put(String key, long value)
Stores a long value.
  • Storing with an already existing key results in a runtime error.
  • When storing a value with a key that may already exist, store using #putForce(String, long).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value long the long value

Return Value

String - the previously stored string

put (Inherited Method)

public String put(String key, LocalDate value)
Stores a date.
  • Storing with an already existing key results in a runtime error.
  • When storing a value with a key that may already exist, store using #putForce(String, LocalDate).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value LocalDate the date

Return Value

String - the previously stored string

put (Inherited Method)

public String put(String key, LocalDateTime value)
Stores a date-time.
  • Storing with an already existing key results in a runtime error.
  • When storing a value with a key that may already exist, store using #putForce(String, LocalDateTime).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value LocalDateTime the date-time

Return Value

String - the previously stored string

put (Inherited Method)

public String put(String key, java.util.Date value)
Stores a UTIL date.
  • Storing with an already existing key results in a runtime error.
  • When storing a value with a key that may already exist, store using #putForce(String, java.util.Date).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value java.util.Date the date (including java.sql.Date)

Return Value

String - the previously stored string

put (Inherited Method)

public String put(String key, java.sql.Timestamp value)
Stores an SQL timestamp.
  • Storing with an already existing key results in a runtime error.
  • When storing a value with a key that may already exist, store using #putForce(String, java.sql.Timestamp).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value java.sql.Timestamp the timestamp

Return Value

String - the previously stored string

put (Inherited Method)

public String put(String key, boolean value)
Stores a boolean value.
  • Storing with an already existing key results in a runtime error.
  • When storing a value with a key that may already exist, store using #putForce(String, boolean).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value boolean the boolean value

Return Value

String - the previously stored string

putForce (Inherited Method)

public String putForce(String key, String value)
Stores a string (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value String the value

Return Value

String - the previously stored string

putForce (Inherited Method)

public String putForce(String key, BigDecimal value)
Stores a numeric value (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value BigDecimal the numeric value

Return Value

String - the previously stored string

putForce (Inherited Method)

public String putForce(String key, int value)
Stores an int value (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value int the int value

Return Value

String - the previously stored string

putForce (Inherited Method)

public String putForce(String key, long value)
Stores a long value (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value long the long value

Return Value

String - the previously stored string

putForce (Inherited Method)

public String putForce(String key, LocalDate value)
Stores a date (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value LocalDate the date

Return Value

String - the previously stored string

putForce (Inherited Method)

public String putForce(String key, LocalDateTime value)
Stores a date-time (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value LocalDateTime the date-time

Return Value

String - the previously stored string

putForce (Inherited Method)

public String putForce(String key, java.util.Date value)
Stores a UTIL date (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value java.util.Date the date (including java.sql.Date)

Return Value

String - the previously stored string

putForce (Inherited Method)

public String putForce(String key, java.sql.Timestamp value)
Stores an SQL timestamp (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value java.sql.Timestamp the timestamp

Return Value

String - the previously stored string

putForce (Inherited Method)

public String putForce(String key, boolean value)
Stores a boolean value (allows overwriting).

Parameters

Name Type Description
key String the key (lowercase letters, numbers, underscores, hyphens, and dots only)
value boolean the boolean value

Return Value

String - the previously stored string

putAll (Inherited Method)

public void putAll(Map<? extends String, ? extends String> map)
Stores all values.
  • Storing with an already existing key results in a runtime error.
  • If keys that may already exist are included, use #putAllForce(Map).

Parameters

Name Type Description
map Map<? extends String, ? extends String> the map

putAllForce (Inherited Method)

public void putAllForce(Map<? extends String, ? extends String> map)
Stores all values (allows overwriting).

Parameters

Name Type Description
map Map<? extends String, ? extends String> the map

size (Inherited Method)

public int size()
Retrieves the map size.

Return Value

int - the map size

isEmpty (Inherited Method)

public boolean isEmpty()
Determines if the map is empty.

Return Value

boolean - true if the map is empty

containsKey (Inherited Method)

public boolean containsKey(Object key)
Checks if a map key exists.

Parameters

Name Type Description
key Object the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

boolean - true if the key exists

containsValue (Inherited Method)

public boolean containsValue(Object value)
Checks if the map contains a value.

Parameters

Name Type Description
value Object the value

Return Value

boolean - true if the value exists

remove (Inherited Method)

public String remove(Object key)
Removes a map value.

Parameters

Name Type Description
key Object the key (lowercase letters, numbers, underscores, hyphens, and dots only)

Return Value

String - the removed value

clear (Inherited Method)

public void clear()
Clears the map.
  • The clear method is prohibited to prevent easy reuse of instances.
  • Please create a new instance instead of clearing.

keySet (Inherited Method)

public Set<String> keySet()
Retrieves the key set.
  • Made read-only because removal would break internal consistency.

Return Value

Set<String> - the key set

values (Inherited Method)

public Collection<String> values()
Retrieves the value collection.
  • Made read-only because removal would break internal consistency.

Return Value

Collection<String> - the value collection

entrySet (Inherited Method)

public Set<Entry<String, String>> entrySet()
Retrieves the entry set.
  • Made read-only because removal would break internal consistency.

Return Value

Set<Entry<String, String>> - the entry set

equals (Inherited Method)

public boolean equals(Object obj)
Compares for equality.
  • Determines equality if the contents are identical.

Parameters

Name Type Description
obj Object the object to compare

Return Value

boolean - true if the contents are identical

hashCode (Inherited Method)

public int hashCode()
Retrieves the hash code.

Return Value

int - the hash code

putAllByBatParam

public int putAllByBatParam(String[] args)
Stores batch parameter values (the content format is the same as URL parameters).
  • Storing with an already existing key results in a runtime error.
  • Accepts multiple arguments as an array to accommodate the length limit per command-line argument.

Parameters

Name Type Description
args String[] batch parameter array (each element is a URL parameter format string)

Return Value

int - the number of stored parameters