public class DevProfile {
public enum SkillLevel { BEGINNER, INTERMEDIATE, ADVANCED }
public enum DevType { FRONTEND, BACKEND, FRONTEND, PENTERSTER }
private static DevProfile instance;
public static class Builder {
private String name;
private DevType type;
private Map<String, SkillLevel> skills = new HashMap<>();
private List<String> tools = new ArrayList<>();
public Builder(String name) {
this.name = name;
}
public Builder setType(DevType type) {
this.type = type;
return this;
}
public Builder addSkill(String skill, SkillLevel level) {
this.skills.put(skill, level);
return this;
}
public Builder addTool(String tool) {
this.tools.add(tool);
return this;
}
public DevProfile build() {
return new DevProfile(this);
}
}
private final String name;
private final DevType type;
private final Map<String, SkillLevel> skills;
private final List<String> tools;
private DevProfile(Builder builder) {
this.name = builder.name;
this.type = builder.type;
this.skills = Collections.unmodifiableMap(new HashMap<>(builder.skills));
this.tools = Collections.unmodifiableList(new ArrayList<>(builder.tools));
}
public static DevProfile getInstance(Builder builder) {
if(instance == null) {
instance = builder.build();
}
return instance;
}
public String getName() { return name; }
public DevType getType() { return type; }
public Map<String, SkillLevel> getSkills() { return skills; }
public List<String> getTools() { return tools; }
public void displayProfile() throws InterruptedException {
System.out.println("\n\n");
printWithDelay(" Name: " + name, 100);
printWithDelay(" Type: " + type.toString(), 100);
System.out.println(" Skills:");
skills.forEach((skill, level) -> {
printWithDelay(" ▸ " + skill + " - " + level, 50);
});
System.out.println(" Tools:");
tools.forEach(tool -> {
printWithDelay(" ▸ " + tool, 30);
});
System.out.println("\n\n");
}
private void printWithDelay(String text, int delay) {
try {
Thread.sleep(delay);
System.out.println(text);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
public static void main(String[] args) throws InterruptedException {
DevProfile profile = DevProfile.getInstance(
new DevProfile.Builder("Luis Otavio")
.setType(DevType.BACKEND)
.addSkill("Java", SkillLevel.INTERMEDIATE)
.addSkill("Python", SkillLevel.ADVANCED)
.addSkill("JavaScript", SkillLevel.INTERMEDIATE)
.addTool("IntelliJ IDEA")
.addTool("VS Code")
.addTool("Git")
);
profile.displayProfile();
}
}
💻
I use arch btw
📍 Based in Brazil 🧠 Learning every day 🛠️ Tech enthusiast | Code explorer | GNU supporter 📬 Open to collaboration and revolutionary ideas
- brazil
Highlights
Pinned Loading
-
github-explorer-framework
github-explorer-framework PublicA powerful and easy-to-use JavaScript framework for interacting with the GitHub API. Fetch user profiles, repositories, commits, and more with minimal setup. Ideal for developers looking to build G…
-
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.