X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=war%2Fsrc%2Fmain%2Fjava%2Fpnews%2FCategory.java;h=ac59c5953b2db4a65200e658b4d6653d3c3b0a80;hb=88a7ba9745b8318ca6c4f741906a40e3d6a8f07e;hp=2d50c0662bfa5622071cce2456b04343980c81d1;hpb=644dd89a5323cb98095c0bd2c209b29679e0033b;p=pnews.git diff --git a/war/src/main/java/pnews/Category.java b/war/src/main/java/pnews/Category.java index 2d50c06..ac59c59 100644 --- a/war/src/main/java/pnews/Category.java +++ b/war/src/main/java/pnews/Category.java @@ -1,23 +1,40 @@ package pnews; -public enum Category { - TOP("top"), - FRANCE("france"), - SPORT("sport"), - EUROPE("europe"), - MONDE("monde"), - ECO("eco"), - ESSONNE("essonne"), - TECHNOLOGIE("technologie"), - PEOPLE("people"); - +public class Category { private final String id; - - private Category(String id) { + private final String label; + private final String title; + private final String language; + + public Category(String id, String label, String title, String language) { this.id = id; + this.label = label; + this.title = title; + this.language = language; + } + + public String getTitle() { + return title; + } + + public String getURL() { + return "/" + language + "/" + id.toLowerCase(); } + public String getLabel() { + return label; + } + public String getId() { return id; } + + public String getLanguage() { + return language; + } + + @Override + public String toString() { + return getLabel(); + } }