org.codeforamerica.open311.facade.data
Class Endpoint

java.lang.Object
  extended by org.codeforamerica.open311.facade.data.Endpoint
All Implemented Interfaces:
Serializable

public class Endpoint
extends Object
implements Serializable

Wraps the information relative to a single endpoint.

Author:
Santiago MunĂ­n
See Also:
Serialized Form

Constructor Summary
Endpoint(String specificationUrl, String url, Date changeset, EndpointType type, List<Format> formats)
           
 
Method Summary
 Format getBestFormat()
          Returns the more suitable format.
 Date getChangeset()
           
 String getSpecificationUrl()
           
 EndpointType getType()
           
 String getUrl()
           
 boolean isCompatibleWithFormat(Format format)
          Returns whether it allows the given format or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Endpoint

public Endpoint(String specificationUrl,
                String url,
                Date changeset,
                EndpointType type,
                List<Format> formats)
Method Detail

getSpecificationUrl

public String getSpecificationUrl()

getUrl

public String getUrl()

getChangeset

public Date getChangeset()

getType

public EndpointType getType()

getBestFormat

public Format getBestFormat()
Returns the more suitable format. Tries JSON before XML.

Returns:
A format allowed by the endpoint.

isCompatibleWithFormat

public boolean isCompatibleWithFormat(Format format)
Returns whether it allows the given format or not.

Parameters:
format - Desired format.
Returns:
true if it allows the given format, else false.


Copyright © 2013 Code for America. All Rights Reserved.