Class Charsets

java.lang.Object
io.inverno.mod.base.Charsets

public final class Charsets extends Object

Utility methods and constants for charsets.

Since:
1.0
Author:
Jeremy Kuhn
  • Field Details

    • ISO_8859_1

      public static final Charset ISO_8859_1
      ISO-8859-1 charset constant
    • UTF_8

      public static final Charset UTF_8
      UTF-8 charset constant
    • DEFAULT

      public static final Charset DEFAULT
      Default charset
  • Method Details

    • orDefault

      public static Charset orDefault(Charset charset)

      Returns the specified charset if not null or the default charset.

      Parameters:
      charset - a charset
      Returns:
      the specified charset or the default charset
    • or

      public static Charset or(Charset charset, Charset other)

      Returns the specified charset if not null or the other charset which must not be null.

      Parameters:
      charset - a charset
      other - another charset
      Returns:
      the specified charset or the other charset
      Throws:
      NullPointerException - if the other charset is null