Example usage for java.util Collections emptyList

List of usage examples for java.util Collections emptyList

Introduction

In this page you can find the example usage for java.util Collections emptyList.

Prototype

@SuppressWarnings("unchecked")
public static final <T> List<T> emptyList() 

Source Link

Document

Returns an empty list (immutable).

Usage

From source file:cpcc.core.utils.RealVehicleUtils.java

/**
 * @param areaOfOperation the area of operation as a {@code String}.
 * @return the list of {@code PolygonZone} instances.
 * @throws IOException in case of errors.
 *//*from w  ww. j a  va  2  s.  co  m*/
public static List<PolygonZone> getPolygons(String areaOfOperation) throws IOException {
    if (StringUtils.isBlank(areaOfOperation)) {
        return Collections.emptyList();
    }

    List<PolygonZone> list = new ArrayList<PolygonZone>();
    FeatureCollection fc = new ObjectMapper().readValue(areaOfOperation.replace("\\n", "\n"),
            FeatureCollection.class);

    for (Feature feature : fc.getFeatures()) {
        GeoJsonObject geom = feature.getGeometry();
        if (geom instanceof Polygon) {
            List<LngLatAlt> coordinates = ((Polygon) geom).getCoordinates().get(0);
            list.add(new PolygonZone(coordinates));
        }
    }

    return list;
}

From source file:com.reprezen.swagedit.core.assist.JsonProposalProvider.java

public JsonProposalProvider() {
    this.extensions = Collections.emptyList();
}

From source file:com.liferay.alloy.taglib.alloy_util.ComponentTag.java

private boolean _isValidAttribute(String key) {
    List<String> excludeAttributes = Collections.emptyList();

    if (getExcludeAttributes() != null) {
        excludeAttributes = Arrays.asList(getExcludeAttributes().split(StringPool.COMMA));
    }//from   w w w. j ava2  s  .c  om

    return !(excludeAttributes.contains(key) || key.equals(_DYNAMIC_ATTRIBUTES));
}

From source file:com.hp.ov.sdk.adaptors.StorageSystemAdaptor.java

@SuppressWarnings("unchecked")
public List<String> buildHostTypesCollectionDto(final String source) {
    if (null == source || source.equals("")) {
        return Collections.emptyList();
    }// w w w.  j ava  2 s  .com
    ObjectToJsonConverter converter = ObjectToJsonConverter.getInstance();
    // convert json object to DTO, replace quotes and back slash in the file
    Type listOfString = new TypeToken<List<String>>() {
    }.getType();
    return (List<String>) converter.convertJsonToListObject(source, listOfString);
}

From source file:newcontroller.handler.impl.DefaultRequest.java

@Override
public List<String> params(String name) {
    String[] values = this.request.getParameterValues(name);
    return values == null ? Collections.emptyList() : Arrays.asList(values);
}

From source file:com.baasbox.service.user.FriendShipService.java

public static List<ODocument> getFollowing(String username, QueryParams criteria) throws SqlInjectionException {
    OUser me = UserService.getOUserByUsername(username);
    Set<ORole> roles = me.getRoles();
    List<String> usernames = roles.parallelStream().map(ORole::getName)
            .filter((x) -> x.startsWith(RoleDao.FRIENDS_OF_ROLE))
            .map((m) -> StringUtils.difference(RoleDao.FRIENDS_OF_ROLE, m)).collect(Collectors.toList());
    if (username.isEmpty()) {
        return Collections.emptyList();
    } else {/*from  w ww. ja va  2  s.  co m*/
        List<ODocument> followers = UserService.getUserProfileByUsernames(usernames, criteria);
        return followers;
    }

}

From source file:com.attribyte.essem.util.Util.java

/**
 * Splits the path into an iterable./*from w w w. ja  va 2 s .  c  o m*/
 * @param request The request.
 * @return The components, or empty iterable if none.
 */
public static final Iterable<String> splitPath(final HttpServletRequest request) {

    String pathInfo = request.getPathInfo();
    if (pathInfo == null || pathInfo.length() == 0 || pathInfo.equals("/")) {
        return Collections.emptyList();
    } else {
        return pathSplitter.split(pathInfo);
    }
}

From source file:com.linecorp.bot.model.message.template.CarouselColumn.java

@JsonCreator
public CarouselColumn(@JsonProperty("thumbnailImageUrl") String thumbnailImageUrl,
        @JsonProperty("title") String title, @JsonProperty("text") String text,
        @JsonProperty("actions") List<Action> actions) {
    this.thumbnailImageUrl = thumbnailImageUrl;
    this.title = title;
    this.text = text;
    this.actions = actions != null ? actions : Collections.emptyList();
}

From source file:com.spotify.styx.model.WorkflowConfiguration.java

@JsonCreator
public static WorkflowConfiguration create(@JsonProperty("id") String id,
        @JsonProperty("schedule") Schedule schedule, @JsonProperty("offset") Optional<String> offset,
        @JsonProperty("docker_image") Optional<String> dockerImage,
        @JsonProperty("docker_args") Optional<List<String>> dockerArgs,
        @JsonProperty("docker_termination_logging") Optional<Boolean> dockerTerminationLogging,
        @JsonProperty("secret") Optional<Secret> secret, @JsonProperty("resources") List<String> resources) {

    return new AutoValue_WorkflowConfiguration(id, schedule, offset, dockerImage, dockerArgs,
            dockerTerminationLogging.orElse(false), secret,
            resources == null ? Collections.emptyList() : resources);
}

From source file:org.zalando.example.zauth.services.AccountConnectionSignupService.java

@Override
public String execute(final Connection<?> connection) {

    Object api = connection.getApi();

    // use the api if you can
    if (api instanceof ZAuth) {
        ZAuth zAuth = (ZAuth) api;/*from  w ww  .  j  ava 2  s. c om*/
        String login = zAuth.getCurrentLogin();
    }

    // or use more generic
    org.springframework.social.connect.UserProfile profile = connection.fetchUserProfile();

    String username = profile.getUsername();

    LOG.info("Created user with id: " + username);

    User user = new User(username, "", Collections.emptyList());
    userDetailsManager.createUser(user);

    return username;
}