Enum Action

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AFFECTS
      The affects action requests all places affected by a particular type of event, such as earthquake or storm cell.
      CLOSEST
      The closest action will query the API for data that is closest to the requested place and return the results, if any, in order from closest to farthest.
      CONTAINS
      The contains action returns data that a specified location is contained within.
      ID
      Requesting data by using the id action is used for returning data for a particular item that has an ID associated with it.
      NONE
      TODO:
      SCHEMA
      The schema action is provides the JSON schema for the particular endpoint.
      SEARCH
      The search action is used as a more general query method and expects the query to be defined with the custom query for the request.
      WITHIN
      The within action allows for returning data within a variety of different geometrical regions.
    • Enum Constant Detail

      • AFFECTS

        public static final Action AFFECTS
        The affects action requests all places affected by a particular type of event, such as earthquake or storm cell. The query for places affected is unique for each endpoint it belongs to and can be a polygon (e.g., storm cell forecasts or warnings) or a circle with the center being the location of the event (e.g., earthquakes or fires). Instead of returning an array of objects specific to the endpoint, the affects action will always return an array of place objects in the same format as the within action on the places endpoint. Note:Requesting data by using the id action is used for returning data for a particular item that has an ID associated with it. This is the primary method for requesting general weather information for a single location (observations, forecasts, advisories, etc.) as the location's name or a zip code serves as the id. Other endpoints may expect a certain value for the ID, such as storm cells whose ID value is a combination of the radar site identifier and unique identifier assigned to every storm cell. Refer to an enpoint's detailed documentation for specific information regarding how to use the id action. Not all endpoints support this action, so refer to each endpoint's complete documentation to determine if supported and its usage.
      • ID

        public static final Action ID
        Requesting data by using the id action is used for returning data for a particular item that has an ID associated with it. This is the primary method for requesting general weather information for a single location (observations, forecasts, advisories, etc.) as the location's name or a zip code serves as the id. Other endpoints may expect a certain value for the ID, such as storm cells whose ID value is a combination of the radar site identifier and unique identifier assigned to every storm cell. Refer to an enpoint's detailed documentation for specific information regarding how to use the id action.
      • CLOSEST

        public static final Action CLOSEST
        The closest action will query the API for data that is closest to the requested place and return the results, if any, in order from closest to farthest. If no limit is provided in the request, then only the closest single result will be returned. If a radius is not provided, then the default of 20 miles will be used. If your request does not return results, you may try setting or increasing the radius being used. Note, however, that a maximum of 250 results can be returned in a single request.
      • SCHEMA

        public static final Action SCHEMA
        The schema action is provides the JSON schema for the particular endpoint. The schema is based on the JSON Schema Internet Draft 3 as available from json-schema.org. When using this schema no parameters are passed to the endpoint.
      • WITHIN

        public static final Action WITHIN
        The within action allows for returning data within a variety of different geometrical regions. Currently supported geometries include a circle (requires a center point and radius), square (requires two coordinate points defining the top-left and bottom-right corners) and polygon (requires at least three coordinate points). Unlike the closest action, the results will not be returned in any particular order based on distance.
      • NONE

        public static final Action NONE
        TODO:
      • SEARCH

        public static final Action SEARCH
        The search action is used as a more general query method and expects the query to be defined with the custom query for the request. Unlike the closest action, results will not be returned in any particular order.
      • CONTAINS

        public static final Action CONTAINS
        The contains action returns data that a specified location is contained within. This action is normally associated with endpoints that contain polygon data, allowing to return only the polygons a point / geometry is contained in. This action can be considered the opposite of the within endpoint.
    • Method Detail

      • values

        public static Action[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Action c : Action.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Action valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getCode

        public String getCode()
        Gets the code for the action to be used during requests.
        Returns:
        the code for the Action.