π«π² Java Enum: Micronesia States
Micronesia is composed of 4 states, each consisting of multiple islands. Each state has an ISO 3166-2:FM code:
java
public enum MicronesiaState {
CHUUK("FM-TRK"),
KOSRAE("FM-KSA"),
POHNPEI("FM-PNI"),
YAP("FM-YAP");
private final String code;
MicronesiaState(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
ποΈ SQL Table and Insert Statements
sql
CREATE TABLE micronesia_states (
id SERIAL PRIMARY KEY,
name VARCHAR(64) NOT NULL,
code VARCHAR(8) NOT NULL UNIQUE
);
INSERT INTO micronesia_states (name, code) VALUES
('Chuuk', 'FM-TRK'),
('Kosrae', 'FM-KSA'),
('Pohnpei', 'FM-PNI'),
('Yap', 'FM-YAP');
β
Summary
This setup models the 4 federated states of Micronesia using standardized ISO codes. Itβs ideal for building country-aware applications with clean, maintainable geography-based data.