🇧🇧 Java Enum: Barbados’ Parishes
Barbados is divided into 11 parishes. Here’s the Java enum using the ISO 3166-2:BB codes.
java
public enum BarbadosParish {
CHRIST_CHURCH("BB-01"),
ST_ANDREW("BB-02"),
ST_GEORGE("BB-03"),
ST_JAMES("BB-04"),
ST_JOHN("BB-05"),
ST_LUCY("BB-06"),
ST_MICHAEL("BB-07"),
ST_PETER("BB-08"),
ST_PHILIP("BB-09"),
ST_THOMAS("BB-10"),
QUEENSLAND("BB-11");
private final String code;
BarbadosParish(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
🗃️ SQL Table and Insert Statements
sql
CREATE TABLE barbados_parishes (
id SERIAL PRIMARY KEY,
name VARCHAR(64) NOT NULL,
code VARCHAR(8) NOT NULL UNIQUE
);
INSERT INTO barbados_parishes (name, code) VALUES
('Christ Church', 'BB-01'),
('St Andrew', 'BB-02'),
('St George', 'BB-03'),
('St James', 'BB-04'),
('St John', 'BB-05'),
('St Lucy', 'BB-06'),
('St Michael', 'BB-07'),
('St Peter', 'BB-08'),
('St Philip', 'BB-09'),
('St Thomas', 'BB-10'),
('Queensland', 'BB-11');
✅ Summary
This setup represents Barbados' 11 parishes using the ISO 3166-2:BB codes. It’s ideal for geographical region management, administrative processing, or any location-based tasks in your applications.