All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.yawenok.apns.http2.enums.response.ResponseCode Maven / Gradle / Ivy

package io.github.yawenok.apns.http2.enums.response;


import java.util.HashMap;
import java.util.Map;

public enum ResponseCode {
    Success(200),
    BadRequest(400),
    InvalidProviderToken(403),
    BadMethod(405),
    DeviceTokenInactiveForTopic(410),
    PayloadTooLarge(413),
    TooManyRequestsForToken(429),
    InternalServerError(500),
    ServerUnavailable(503);

    private final int code;

    ResponseCode(final int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    private static Map codeMap = new HashMap<>();
    static {
        for (final ResponseCode responseCode : ResponseCode.values()) {
            codeMap.put(responseCode.getCode(), responseCode);
        }
    }
    public static ResponseCode getResponseCode(int code) {
        return codeMap.get(code);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy