Skip to content

BaseHelper ​

com.jsmacrosce.jsmacros.core.helpers.BaseHelper

Base class for helpers that wrap a raw value; it is abstract and is not a standalone script global.

js
const text = Chat.createTextHelperFromString("hello");  
const component = text.getRaw();

Type Parameters ​

  • T: type of the wrapped value

Constructors ​

new BaseHelper ​

new BaseHelper(T base)#
Stores the supplied value without validation; null is retained as-is.

Parameters:

  • base: value to wrap

Methods ​

equals ​

equals(Object obj): boolean#
Compares wrapped values when obj is a BaseHelper; otherwise compares the wrapped value directly with obj. This delegates to the stored value's equals and throws NullPointerException if that value is null.

Parameters:

  • obj: object to compare
Returns: whether the delegated comparison reports equality

getRaw ​

getRaw(): T#
Returns the wrapped value, which may be null.
Returns: the stored value

hashCode ​

hashCode(): int#
Returns the wrapped value's hash code; throws NullPointerException if it is null.
Returns: the raw value's hash code