🇧🇦 Java Enum: Bosnia and Herzegovina’s Entities
Bosnia and Herzegovina is divided into 2 entities and the Brčko District. Here’s the Java enum using the ISO 3166-2:BA codes.
java
public enum BosniaAndHerzegovinaEntity {
FEDERATION_OF_BOSNIA_AND_HERZEGOVINA("BA-FB"),
REPUBLIKA_SRPSKA("BA-RS"),
BRCKO_DISTRICT("BA-BK");
private final String code;
BosniaAndHerzegovinaEntity(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
🗃️ SQL Table and Insert Statements
sql
CREATE TABLE bosnia_herzegovina_entities (
id SERIAL PRIMARY KEY,
name VARCHAR(64) NOT NULL,
code VARCHAR(8) NOT NULL UNIQUE
);
INSERT INTO bosnia_herzegovina_entities (name, code) VALUES
('Federation of Bosnia and Herzegovina', 'BA-FB'),
('Republika Srpska', 'BA-RS'),
('Brčko District', 'BA-BK');
✅ Summary
This setup represents Bosnia and Herzegovina’s 2 entities and the Brčko District using the ISO 3166-2:BA codes. It’s ideal for managing geographical regions, administrative divisions, and location-based tasks in your applications.