Package io.github.zazalng.utils


package io.github.zazalng.utils
Internal utility classes and helper functions for the ThaiBaht conversion library.

This package contains non-public utility implementations that support the core conversion functionality. These classes are internal to the library and not part of the public API.

Purpose

The io.github.zazalng.utils package provides:

  • Number Conversion Utilities: Helper methods for converting numeric values and performing calculations
  • String Processing: Common string manipulation and formatting operations
  • Validation Helpers: Input validation and constraint checking
  • Data Transformation: Internal data structure conversions

Design Principles

  • Package-Private: All classes in this package are package-private and not exposed in the public API
  • Supporting Role: Classes exist solely to support public API classes like ThaiBaht and ThaiBahtConfig
  • No External Dependencies: Utilities use only standard Java libraries
  • Thread-Safe: All utility methods are stateless and thread-safe
  • Reusability: Common operations are extracted to avoid duplication

Internal Implementation Details

While these utilities support the public API, they are subject to change without notice between versions. External code should not depend on classes in this package:

  • No backward compatibility guarantees for internal implementations
  • Method signatures may change between minor versions
  • New utilities may be added or removed as needed
  • Use the public API (ThaiBaht, ThaiBahtConfig) for stable, supported functionality

Common Utility Categories

Number and Monetary Calculations

Internal utilities handle:

  • Breaking down BigDecimal amounts into baht and satang components
  • Validating monetary values (non-negative, precision constraints)
  • Rounding and formatting currency amounts
  • Handling edge cases (zero, maximum values, etc.)

Text Processing

Internal utilities provide:

  • String concatenation and formatting
  • Language-specific text transformations
  • Prefix and suffix management
  • Character case handling

Configuration and Constants

Internal utilities manage:

  • Language-specific constants and lookup tables
  • Default configuration values
  • Validation rules and constraints
  • Supported language definitions

Usage Notes for Maintainers

When extending the ThaiBaht library:

  • Add new internal utilities to this package rather than the public package
  • Keep utilities focused and single-purpose
  • Document assumptions about input validity
  • Ensure all utilities are stateless and thread-safe
  • Write comprehensive unit tests for utility methods
  • Avoid circular dependencies between utility classes

Related Packages

See Also

External code should not import from this package. Use the public API instead:

Since:
1.0
Version:
1.3.0
Author:
Zazalng
  • Classes
    Class
    Description
    Immutable template for custom format strings with named placeholder support (v1.4.0+).