Tag

Enum

1 views collected around this technical thread.

Selected Java Interview Questions
Selected Java Interview Questions
Jun 11, 2025 · Backend Development

Master Java Enums: Eliminate if/else and Boost Code Quality

This article revisits Java's enum type, explaining its definition, constructors, methods, and practical uses such as replacing if/else logic, implementing interfaces, enhancing type safety, and applying enums in switch statements and singleton patterns, complete with code examples and best‑practice tips.

EnumJavadesign patterns
0 likes · 9 min read
Master Java Enums: Eliminate if/else and Boost Code Quality
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
May 10, 2025 · Frontend Development

enum-plus: A TypeScript Enhanced Enum Library for Frontend Development

enum-plus is a lightweight, zero-dependency TypeScript library that extends native enums with customizable display text, localization, and seamless integration into popular frontend UI frameworks such as Ant Design, ElementPlus, and Material-UI, providing rich methods for enumeration handling, UI component binding, and type-safe development.

EnumTypeScriptUI
0 likes · 16 min read
enum-plus: A TypeScript Enhanced Enum Library for Frontend Development
Java Captain
Java Captain
Apr 23, 2025 · Backend Development

Custom MyBatis TypeHandler for Automatic JSON and Enum Conversion

This article explains how to create custom MyBatis TypeHandler classes to automatically convert Java objects—such as JSON strings and enum codes—to appropriate JDBC types, simplifying data persistence in Spring Boot applications and improving code maintainability.

EnumJSONJava
0 likes · 9 min read
Custom MyBatis TypeHandler for Automatic JSON and Enum Conversion
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Mar 21, 2025 · Fundamentals

Master Java Enums: From Basics to Advanced Real-World Patterns

This article introduces a Spring Boot 3 case collection and provides a comprehensive guide to Java enums, covering their definition, type safety, custom values, interface implementation, abstract methods, generics, pattern matching, functional programming, collection usage, and sealed‑class integration with clear code examples.

EnumJavaSpring Boot
0 likes · 9 min read
Master Java Enums: From Basics to Advanced Real-World Patterns
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Mar 18, 2025 · Fundamentals

Why TypeScript Seems to Discourage Enums and What Alternatives Exist

This article explains the new --erasableSyntaxOnly option in TypeScript, distinguishes erasable from non‑erasable syntax, shows why enums are considered problematic, and presents several practical alternatives such as const enums, template literal types, union types, const assertions, and class‑based enums.

EnumTypeScriptalternatives
0 likes · 10 min read
Why TypeScript Seems to Discourage Enums and What Alternatives Exist
php中文网 Courses
php中文网 Courses
Mar 11, 2025 · Backend Development

New Features and Improvements in PHP 8.4

The article reviews PHP 8.4's major enhancements—including JIT compiler optimizations, new array_find and array_find_key functions, an enhanced match expression, str_contains_any/all utilities, nullsafe operator upgrades, enum type extensions, and overall performance and stability improvements—helping developers adopt the latest capabilities for more efficient backend development.

EnumJITMatch Expression
0 likes · 8 min read
New Features and Improvements in PHP 8.4
Java Tech Enthusiast
Java Tech Enthusiast
Feb 11, 2025 · Backend Development

Using Enums for Configuration Management in Spring Boot

The article shows how to replace hard‑coded strings in Spring Boot configuration files with type‑safe Java enums, using @ConfigurationProperties to bind YAML values to enum fields, thereby improving readability, maintainability, and eliminating magic numbers, illustrated through a user‑role example with controller and Thymeleaf view.

ConfigurationPropertiesEnumJava
0 likes · 12 min read
Using Enums for Configuration Management in Spring Boot
Top Architect
Top Architect
Nov 28, 2024 · Backend Development

A Comprehensive Guide to Java Enums: Basics, Advanced Usage, and Design Patterns

This article explains Java enums introduced in Java 5, shows how to define simple and complex enum types, demonstrates their use in comparisons, switch statements, collections like EnumSet and EnumMap, and illustrates applying enums to design patterns such as Singleton and Strategy, while providing practical code examples and JSON serialization techniques.

EnumJavabackend
0 likes · 16 min read
A Comprehensive Guide to Java Enums: Basics, Advanced Usage, and Design Patterns
Architecture Digest
Architecture Digest
Nov 13, 2024 · Backend Development

Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum-based Error Codes

This article explains how to replace repetitive try‑catch blocks in Java backend development with a unified exception handling approach using Spring's @ControllerAdvice, custom Assert utilities, and enum‑based error codes, providing cleaner code, consistent error responses, and easy internationalization.

AssertEnumException Handling
0 likes · 20 min read
Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum-based Error Codes
Architecture Development Notes
Architecture Development Notes
Sep 12, 2024 · Fundamentals

Boost Rust Performance with Clone‑On‑Write (COW): When and How to Use It

This article explains Rust's Clone‑On‑Write (COW) feature, showing how it reduces unnecessary memory allocations, detailing its internal enum variants, typical use cases, performance benefits, limitations, and providing practical code examples for function return values and string concatenation.

COWClone on WriteEnum
0 likes · 7 min read
Boost Rust Performance with Clone‑On‑Write (COW): When and How to Use It
Architect's Guide
Architect's Guide
Sep 3, 2024 · Backend Development

Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum

This article explains how to replace repetitive try‑catch blocks in Java backend code with a unified exception handling mechanism based on Spring's @ControllerAdvice, custom Assert utilities, and error‑code enums, resulting in cleaner, more maintainable services and controllers.

AssertEnumException Handling
0 likes · 21 min read
Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum
Code Mala Tang
Code Mala Tang
Aug 15, 2024 · Frontend Development

Mastering TypeScript Enums: Numeric, String, and Const Variants Explained

This article explains how TypeScript enums work, covering numeric, string, and const enums, their compilation behavior, reverse mappings, type differences, and best‑practice usage to write clearer and more maintainable code.

EnumTypeScriptconst enum
0 likes · 8 min read
Mastering TypeScript Enums: Numeric, String, and Const Variants Explained
php中文网 Courses
php中文网 Courses
May 9, 2024 · Backend Development

Using Enums in PHP: Interfaces, Traits, Attributes, and Best Practices

This article explains PHP enums, showing how they improve code readability and safety, and demonstrates their integration with interfaces, traits, attributes, validation rules, casting, and matching mechanisms, providing practical examples and best‑practice recommendations for backend developers.

AttributeEnumPHP
0 likes · 7 min read
Using Enums in PHP: Interfaces, Traits, Attributes, and Best Practices
DaTaobao Tech
DaTaobao Tech
Jan 15, 2024 · Backend Development

Refactoring Java Sale‑Type Parsing: From Simple Method to Design Patterns

Starting from a basic Java method that maps a sale‑type string to an integer, the article incrementally refactors the code by applying null‑safe utilities, constants, static methods, ternary/Optional expressions, enums with lookup maps, a combined relation enum, and finally a Strategy pattern with a container, illustrating how each step improves safety, readability, extensibility, and testability.

EnumJavaOptional
0 likes · 13 min read
Refactoring Java Sale‑Type Parsing: From Simple Method to Design Patterns
macrozheng
macrozheng
Jan 12, 2024 · Backend Development

Unlock Java Enums: Deep Dive into Their Essence, Usage, and Advanced Patterns

This article explains Java enums, their underlying class inheritance, key Enum methods, practical code examples, and advanced uses such as implementing singletons and strategy patterns, helping developers master enums for robust backend development.

EnumJavabackend
0 likes · 7 min read
Unlock Java Enums: Deep Dive into Their Essence, Usage, and Advanced Patterns
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Dec 19, 2023 · Backend Development

Why Comparing Integer Objects with == Fails for Values Outside the Cache Range in Java

The article explains a junior developer's intermittent bug when adding a new order status with code 200, showing that Java's Integer cache and the use of == instead of equals cause the status check to fail, and provides the correct solution.

== vs equalsEnumJava
0 likes · 5 min read
Why Comparing Integer Objects with == Fails for Values Outside the Cache Range in Java
Top Architect
Top Architect
Dec 5, 2023 · Backend Development

Unified Exception Handling and Assertion Practices in Spring Boot Backend Development

This article explains how to implement unified exception handling in Spring Boot applications using @ControllerAdvice, custom Assert utilities, and enum-based error codes, demonstrating code examples, response structures, and best practices for reducing try-catch clutter, improving readability, and handling various HTTP and business exceptions consistently.

AssertBackend DevelopmentEnum
0 likes · 24 min read
Unified Exception Handling and Assertion Practices in Spring Boot Backend Development
Architect's Guide
Architect's Guide
Nov 27, 2023 · Backend Development

Unified Exception Handling in Spring Boot: Design, Implementation, and Best Practices

This article provides a comprehensive guide to designing and implementing a unified exception handling framework in Spring Boot, covering the use of @ControllerAdvice, custom assertion interfaces, enum‑based error codes, standardized response structures, and practical testing scenarios to improve code readability and robustness.

AssertionsEnumException Handling
0 likes · 20 min read
Unified Exception Handling in Spring Boot: Design, Implementation, and Best Practices
DeWu Technology
DeWu Technology
Nov 20, 2023 · Backend Development

State Machine Evaluation and Selection for Product Domain

The article analyzes DeWu’s product lifecycle, explains New, Product, and Draft types, introduces state‑machine fundamentals, compares Java enum, Spring, Squirrel, and Cola implementations, benchmarks their throughput (showing Cola vastly faster), and concludes that despite Cola’s performance, Spring StateMachine is chosen for its richer features and seamless Spring integration.

COLAEnumJava
0 likes · 27 min read
State Machine Evaluation and Selection for Product Domain
Top Architecture Tech Stack
Top Architecture Tech Stack
Oct 13, 2023 · Fundamentals

Java Singleton Pattern: Eager, Lazy, Double‑Check Locking, Holder, and Enum Implementations

This article explains several common Java singleton implementations—including lazy ("hungry"), eager, double‑checked locking, holder, and enum patterns—detailing their code, thread‑safety characteristics, performance trade‑offs, and pitfalls such as partial initialization and reflection attacks.

DesignPatternEnumJava
0 likes · 10 min read
Java Singleton Pattern: Eager, Lazy, Double‑Check Locking, Holder, and Enum Implementations