nu.yona.server.rest.RestUtil.java Source code

Java tutorial

Introduction

Here is the source code for nu.yona.server.rest.RestUtil.java

Source

/*******************************************************************************
 * Copyright (c) 2016, 2017 Stichting Yona Foundation This Source Code Form is subject to the terms of the Mozilla Public License, v.
 * 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
 *******************************************************************************/
package nu.yona.server.rest;

import org.springframework.http.HttpStatus;

public class RestUtil {
    private RestUtil() {
        // No instances
    }

    public static boolean isError(HttpStatus status) {
        HttpStatus.Series series = status.series();
        return (series == HttpStatus.Series.CLIENT_ERROR || series == HttpStatus.Series.SERVER_ERROR);
    }
}