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

com.yahoo.vespa.hosted.controller.api.integration.billing.BillStatus Maven / Gradle / Ivy

There is a newer version: 8.253.3
Show newest version
package com.yahoo.vespa.hosted.controller.api.integration.billing;

/**
 * @author gjoranv
 */
public enum BillStatus {
    OPEN,       // All bills start in this state. The bill can be modified and exported/synced to external systems.
    FROZEN,     // Syncing to external systems is switched off. No changes can be made.
    CLOSED,     // End state for a valid bill.
    VOID;       // End state, indicating that the bill is not valid.

    // Legacy states, used by historical bills
    private static final String LEGACY_ISSUED = "ISSUED";
    private static final String LEGACY_EXPORTED = "EXPORTED";
    private static final String LEGACY_CANCELED = "CANCELED";

    private final String value;

    BillStatus() {
        this.value = name();
    }

    public String value() {
        return value;
    }

    public static BillStatus from(String status) {
        if (LEGACY_ISSUED.equals(status) || LEGACY_EXPORTED.equals(status)) return OPEN;
        if (LEGACY_CANCELED.equals(status)) return VOID;
        return Enum.valueOf(BillStatus.class, status.toUpperCase());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy