
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
com.github.avatar21:enum-objectify
Advanced tools
Java Enum bean object conversion Utilities
class Test {
public static void main(String[] args){
DescriptiveEnumObject<SexEnum, Character> sexEnum = EnumObjectUtils.asDescriptiveEnumObject(DescriptiveEnumObject.class, SexEnum.FEMALE);
System.out.println(String.format("sex enum = %s", gson.toJson(sexEnum)));
}
}
// === enum class ... ===
public enum SexEnum implements IDescriptiveEnum<Character> {
MALE('M', "male"), FEMALE('F', "FEMALE");
SexEnum(char code, String description) {
// implement enum ...
}
}
// === enum object class ===
class SexEnumObject extends DescriptiveEnumObject<SexEnum, Character> {
// implement constructor ...
public SexEnumObject(SexEnum enumInstance) {
super(enumInstance);
}
}
// === usage ===
public class TestMain {
public static void main(String[] args) {
Gson gson = new Gson();
SexEnumObject mSexObj = EnumObjectUtils.asDescriptiveEnumObject(SexEnumObject.class, SexEnum.MALE);
System.out.println("sex = "+gson.toJson(mSexOb));
}
}
// === usage ===
public class TestMain {
public static void main(String[] args) {
SexEnum mSex = EnumObjectUtils.getByCode(SexEnum.class, "M");
}
}
// === usage ===
public class TestMain {
public static void main(String[] args) {
List<SexEnumObject> sexEnumObjList = EnumObjectUtils.asDescriptiveEnumObjectList(SexEnum.class, SexEnumObject.class);
System.out.println(String.format("SexEnum.values() as obj list = %s", gson.toJson(sexEnumObjList)));
}
}
// === usage ===
public class TestMain {
public static void main(String[] args) {
Map<Character, SexEnumObject> sexEnumObjMap = EnumObjectUtils.asDescriptiveEnumObjectMap(SexEnum.class, SexEnumObject.class);
System.out.println(String.format("SexEnum.values() as obj map = %s", gson.toJson(sexEnumObjMap)));
}
}
FAQs
Java Enum object bean conversion Utilities
We found that com.github.avatar21:enum-objectify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.