1 package ch.odi.justblog.discovery; 2 3 import java.net.MalformedURLException; 4 import java.net.URL; 5 6 /*** 7 * A API entry defined by RSD. Objects of this class are immutable. 8 * 9 * @author oglueck 10 */ 11 public class RsdApi { 12 private String name; 13 private boolean preferred; 14 private URL apiUrl; 15 private String blogId; 16 17 /*** 18 * 19 */ 20 public RsdApi(String name, boolean preferred, URL apiUrl, String blogId) { 21 this.name = name; 22 this.preferred = preferred; 23 try { 24 this.apiUrl = new URL(apiUrl.toExternalForm()); 25 } catch (MalformedURLException e) { 26 throw new RuntimeException(e); 27 } 28 this.blogId = blogId; 29 } 30 31 /*** 32 * @return Returns the apiUrl. 33 */ 34 public URL getApiUrl() { 35 return apiUrl; 36 } 37 38 /*** 39 * @return Returns the blogId. 40 */ 41 public String getBlogId() { 42 return blogId; 43 } 44 45 /*** 46 * @return Returns the name. 47 */ 48 public String getName() { 49 return name; 50 } 51 52 /*** 53 * @return Returns the preferred. 54 */ 55 public boolean isPreferred() { 56 return preferred; 57 } 58 }