blob: 6b267e538e71e5a3dc440fc7e826ab929618fb48 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.billing;
import java.util.List;
import java.util.Optional;
/**
* Registry of all current plans we have support for
*
* @author ogronnesby
*/
public interface PlanRegistry {
/** Get the default plan */
Plan defaultPlan();
/** Get a plan given a plan ID */
Optional<Plan> plan(PlanId planId);
/** Get a set of all plans */
List<Plan> all();
/** Get a plan give a plan ID */
default Optional<Plan> plan(String planId) {
if (planId == null || planId.isBlank())
return Optional.empty();
return plan(PlanId.from(planId));
}
}
|