Android Open Source - AndroidPlaces Place Type






From Project

Back to project page AndroidPlaces.

License

The source code is released under:

Apache License

If you think the Android project AndroidPlaces listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2014 Brian Lee/*from   w ww . j  a v a 2  s  .c o m*/
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.tigerpenguin.places.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.tigerpenguin.places.deserializer.PlaceTypeDeserializer;

import java.util.Locale;

@JsonDeserialize(using = PlaceTypeDeserializer.class)
public enum PlaceType {

    // filterable places
    ACCOUNTING("accounting", true),
    AIRPORT("airport", true),
    AMUSEMENT_PARK("amusement_park", true),
    AQUARIUM("aquarium", true),
    ART_GALLERY("art_gallery", true),
    ATM("atm", true),
    BAKERY("bakery", true),
    BANK("bank", true),
    BAR("bar", true),
    BEAUTY_SALON("beauty_salon", true),
    BICYCLE_STORE("bicycle_store", true),
    BOOK_STORE("book_store", true),
    BOWLING_ALLEY("bowling_alley", true),
    BUS_STATION("bus_station", true),
    CAFE("cafe", true),
    CAMPGROUND("campground", true),
    CAR_DEALER("car_dealer", true),
    CAR_RENTAL("car_rental", true),
    CAR_REPAIR("car_repair", true),
    CAR_WASH("car_wash", true),
    CASINO("casino", true),
    CEMETERY("cemetery", true),
    CHURCH("church", true),
    CITY_HALL("city_hall", true),
    CLOTHING_STORE("clothing_store", true),
    CONVENIENCE_STORE("convenience_store", true),
    COURTHOUSE("courthouse", true),
    DENTIST("dentist", true),
    DEPARTMENT_STORE("department_store", true),
    DOCTOR("doctor", true),
    ELECTRICIAN("electrician", true),
    ELECTRONICS_STORE("electronics_store", true),
    EMBASSY("embassy", true),
    ESTABLISHMENT("establishment", true),
    FINANCE("finance", true),
    FIRE_STATION("fire_station", true),
    FLORIST("florist", true),
    FOOD("food", true),
    FUNERAL_HOME("funeral_home", true),
    FURNITURE_STORE("furniture_store", true),
    GAS_STATION("gas_station", true),
    GENERAL_CONTRACTOR("general_contractor", true),
    GROCERY_OR_SUPERMARKET("grocery_or_supermarket", true),
    GYM("gym", true),
    HAIR_CARE("hair_care", true),
    HARDWARE_STORE("hardware_store", true),
    HEALTH("health", true),
    HINDU_TEMPLE("hindu_temple", true),
    HOME_GOODS_STORE("home_goods_store", true),
    HOSPITAL("hospital", true),
    INSURANCE_AGENCY("insurance_agency", true),
    JEWELRY_STORE("jewelry_store", true),
    LAUNDRY("laundry", true),
    LAWYER("lawyer", true),
    LIBRARY("library", true),
    LIQUOR_STORE("liquor_store", true),
    LOCAL_GOVERNMENT_OFFICE("local_government_office", true),
    LOCKSMITH("locksmith", true),
    LODGING("lodging", true),
    MEAL_DELIVERY("meal_delivery", true),
    MEAL_TAKEAWAY("meal_takeaway", true),
    MOSQUE("mosque", true),
    MOVIE_RENTAL("movie_rental", true),
    MOVIE_THEATER("movie_theater", true),
    MOVING_COMPANY("moving_company", true),
    MUSEUM("museum", true),
    NIGHT_CLUB("night_club", true),
    PAINTER("painter", true),
    PARK("park", true),
    PARKING("parking", true),
    PET_STORE("pet_store", true),
    PHARMACY("pharmacy", true),
    PHYSIOTHERAPIST("physiotherapist", true),
    PLACE_OF_WORSHIP("place_of_worship", true),
    PLUMBER("plumber", true),
    POLICE("police", true),
    POST_OFFICE("post_office", true),
    REAL_ESTATE_AGENCY("real_estate_agency", true),
    RESTAURANT("restaurant", true),
    ROOFING_CONTRACTOR("roofing_contractor", true),
    RV_PARK("rv_park", true),
    SCHOOL("school", true),
    SHOE_STORE("shoe_store", true),
    SHOPPING_MALL("shopping_mall", true),
    SPA("spa", true),
    STADIUM("stadium", true),
    STORAGE("storage", true),
    STORE("store", true),
    SUBWAY_STATION("subway_station", true),
    SYNAGOGUE("synagogue", true),
    TAXI_STAND("taxi_stand", true),
    TRAIN_STATION("train_station", true),
    TRAVEL_AGENCY("travel_agency", true),
    UNIVERSITY("university", true),
    VETERINARY_CARE("veterinary_care", true),
    ZOO("zoo", true),

    // unfilterable places
    ADMINISTRATIVE_AREA_LEVEL_1("administrative_area_level_1", false),
    ADMINISTRATIVE_AREA_LEVEL_2("administrative_area_level_2", false),
    ADMINISTRATIVE_AREA_LEVEL_3("administrative_area_level_3", false),
    COLLOQUIAL_AREA("colloquial_area", false),
    COUNTRY("country", false),
    FLOOR("floor", false),
    GEOCODE("geocode", false),
    INTERSECTION("intersection", false),
    LOCALITY("locality", false),
    NATURAL_FEATURE("natural_feature", false),
    NEIGHBORHOOD("neighborhood", false),
    POLITICAL("political", false),
    POINT_OF_INTEREST("point_of_interest", false),
    POST_BOX("post_box", false),
    POSTAL_CODE("postal_code", false),
    POSTAL_CODE_PREFIX("postal_code_prefix", false),
    POSTAL_CODE_SUFFIX("postal_code_suffix", false),
    POSTAL_TOWN("postal_town", false),
    PREMISE("premise", false),
    ROOM("room", false),
    ROUTE("route", false),
    STREET_ADDRESS("street_address", false),
    STREET_NUMBER("street_number", false),
    SUBLOCALITY("sublocality", false),
    SUBLOCALITY_LEVEL_4("sublocality_level_4", false),
    SUBLOCALITY_LEVEL_5("sublocality_level_5", false),
    SUBLOCALITY_LEVEL_3("sublocality_level_3", false),
    SUBLOCALITY_LEVEL_2("sublocality_level_2", false),
    SUBLOCALITY_LEVEL_1("sublocality_level_1", false),
    SUBPREMISE("subpremise", false),
    TRANSIT_STATION("transit_station", false),

    UNKNOWN("unknown", false);

    private final String type;
    private final boolean filterable;
    private String formattedName;

    PlaceType(String type, boolean filterable) {
        this.type = type;
        this.filterable = filterable;
    }

    public String getJsonValue() {
        return type;
    }

    public boolean isFilterable() {
        return filterable;
    }

    @Override
    public String toString() {
        if (formattedName == null) {
            String lowerCaseName = name().replace("_", " ").toLowerCase(Locale.US);
            String[] words = lowerCaseName.split(" ");
            StringBuilder sb = new StringBuilder();
            boolean first = true;
            for (String word : words) {
                if (first) {
                    first = false;
                } else {
                    sb.append(" ");
                }
                sb.append(word.substring(0, 1).toUpperCase(Locale.US)).append(word.substring(1));
            }
            formattedName = sb.toString();
        }
        return formattedName;
    }
}




Java Source Code List

com.tigerpenguin.demo.places.PlaceDetailActivity.java
com.tigerpenguin.demo.places.PlaceResultAdapter.java
com.tigerpenguin.demo.places.PlaceResultsFragment.java
com.tigerpenguin.demo.places.PlaceReviewAdapter.java
com.tigerpenguin.demo.places.PlaceReviewsFragment.java
com.tigerpenguin.demo.places.PlaceThumbnailAdapter.java
com.tigerpenguin.demo.places.PlaceThumbnailsFragment.java
com.tigerpenguin.demo.places.PlacesDemo.java
com.tigerpenguin.places.PlacesTest.java
com.tigerpenguin.places.deserializer.HtmlStringDeserializer.java
com.tigerpenguin.places.deserializer.PlaceTypeDeserializer.java
com.tigerpenguin.places.model.AddressComponent.java
com.tigerpenguin.places.model.AspectRating.java
com.tigerpenguin.places.model.AspectType.java
com.tigerpenguin.places.model.DayOfWeek.java
com.tigerpenguin.places.model.DayTime.java
com.tigerpenguin.places.model.Geometry.java
com.tigerpenguin.places.model.JsonModel.java
com.tigerpenguin.places.model.Language.java
com.tigerpenguin.places.model.OpeningHours.java
com.tigerpenguin.places.model.Period.java
com.tigerpenguin.places.model.Photo.java
com.tigerpenguin.places.model.PlaceDetail.java
com.tigerpenguin.places.model.PlaceLocation.java
com.tigerpenguin.places.model.PlaceType.java
com.tigerpenguin.places.model.Place.java
com.tigerpenguin.places.model.PriceLevel.java
com.tigerpenguin.places.model.RankBy.java
com.tigerpenguin.places.model.Review.java
com.tigerpenguin.places.model.StatusCode.java
com.tigerpenguin.places.request.InvalidRequestException.java
com.tigerpenguin.places.request.NearbySearchRequestTest.java
com.tigerpenguin.places.request.NearbySearchRequest.java
com.tigerpenguin.places.request.PlaceDetailRequestTest.java
com.tigerpenguin.places.request.PlaceDetailRequest.java
com.tigerpenguin.places.request.PlaceSearchRequestTest.java
com.tigerpenguin.places.request.PlaceSearchRequest.java
com.tigerpenguin.places.request.PlacesRequestTest.java
com.tigerpenguin.places.request.PlacesRequest.java
com.tigerpenguin.places.request.RequestTest.java
com.tigerpenguin.places.response.NearbySearchResponseFactory.java
com.tigerpenguin.places.response.NearbySearchResponse.java
com.tigerpenguin.places.response.PlaceDetailResponseFactory.java
com.tigerpenguin.places.response.PlaceDetailResponse.java
com.tigerpenguin.places.response.PlaceSearchResponse.java
com.tigerpenguin.places.response.PlacesResponseFactory.java
com.tigerpenguin.places.response.PlacesResponse.java
com.tigerpenguin.places.responsehandler.NearbySearchHandlerFragment.java
com.tigerpenguin.places.responsehandler.PlaceDetailResponseHandlerFragment.java
com.tigerpenguin.places.responsehandler.PlacesResponseHandler.java
com.tigerpenguin.widget.simpleratingbar.MockAttributes.java
com.tigerpenguin.widget.simpleratingbar.SimpleRatingBarAttributes.java
com.tigerpenguin.widget.simpleratingbar.SimpleRatingBarTest.java
com.tigerpenguin.widget.simpleratingbar.SimpleRatingBar.java