Enum Class IntentionallyStatic.Reason
- All Implemented Interfaces:
Serializable, Comparable<IntentionallyStatic.Reason>, Constable
- Enclosing class:
IntentionallyStatic
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA monotonic counter, sequence or accumulator, where sharing across users is the feature: it behaves like a database sequence, so gaps and interleaving are fine.A constant of a mutable type that is never mutated —List.of(…), an array written once and only read.A process-level service rather than data: a connection pool, a HibernateSessionFactory, a logger, a thread pool.State global to all users rather than to the app, and read-mostly: immutable configuration, read-only reference data. -
Method Summary
Modifier and TypeMethodDescriptionstatic IntentionallyStatic.ReasonReturns the enum constant of this class with the specified name.static IntentionallyStatic.Reason[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
IMMUTABLE_CONSTANT
A constant of a mutable type that is never mutated —List.of(…), an array written once and only read.Evidence: no write reference outside initialization, and no mutating call on the object. If either exists, this is the wrong reason.
-
WORLD_GLOBAL_READ_MOSTLY
State global to all users rather than to the app, and read-mostly: immutable configuration, read-only reference data. The tree's test — does the state come from, or feed, a resource outside the process (the database, the classpath, deployment config)?Read-mostly is a query, not an impression: no write reference outside initialization, counting the field's own initializer, a
static { }block and a guarded lazy-init (if (x == null) x = …) as initialization and everything else as mutation.A cache the app writes on save is not this — the write query refutes the claim. Such a cache is still correct shared and stale per-tab, so it stays at application scope; it just belongs under
JVM_INFRASTRUCTURE, or with the sharing fixed at its source. -
JVM_INFRASTRUCTURE
A process-level service rather than data: a connection pool, a HibernateSessionFactory, a logger, a thread pool. Correct as a static for the same reason it was on the desktop, and the migration leaves it alone.Note the boundary — the factory belongs here; a current session or current transaction does not, being per-user or per-call.
-
COUNTER
A monotonic counter, sequence or accumulator, where sharing across users is the feature: it behaves like a database sequence, so gaps and interleaving are fine. The opposite default from user-specific state.The exception, and why
IntentionallyStatic.note()is worth writing here: move it to session scope when a user must see a contiguous private sequence — the number is shown to them as "your record #1, #2, #3" and must not skip.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-