/
FallbackType.java
81 lines (73 loc) · 2.29 KB
/
FallbackType.java
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
* Copyright (C) 2018 - present by Marc Henrard.
*/
package marc.henrard.murisq.product.generic;
import org.joda.convert.FromString;
import org.joda.convert.ToString;
import com.opengamma.strata.collect.named.EnumNames;
import com.opengamma.strata.collect.named.NamedEnum;
/**
* The types of a IBOR fallback.
*/
public enum FallbackType implements NamedEnum {
/**
* The Spot Overnight Rate option.
*/
SPOT_OVERNIGHT,
/**
* The Compounded Setting in Arrears Rate option, based on calculation period.
*/
COMPOUNDED_IN_ARREARS_CALCPERIOD,
/**
* The Compounded Setting in Advance Rate option.
*/
COMPOUNDED_IN_ADVANCE,
/**
* The OIS Benchmark options.
*/
OIS_BENCHMARK,
/**
* The Compounded Setting in Arrears Rate, shifted by 2 business days, based on IBOR period.
*/
COMPOUNDED_IN_ARREARS_2DAYS_IBORPERIOD,
/**
* The Compounded Setting in Arrears Rate, shifted by 2 business days, based on calculation period.
*/
COMPOUNDED_IN_ARREARS_2DAYS_CALCPERIOD,
/**
* The Compounded Setting in Arrears Rate, with start accrual date shifted 2 business days and period
* based on Ibor tenor. As published in Bloomberg IBOR fallback rule book.
*/
COMPOUNDED_IN_ARREARS_2DAYS_TENOR,
/**
* The Compounded Setting in Arrears Rate, with start accrual date shifted 2 business days and period
* based on Ibor tenor. As published in Bloomberg IBOR fallback rule book. With the extra requirement
* that the last rate published two business days preceding the related payment date is used.
*/
COMPOUNDED_IN_ARREARS_2DAYS_TENOR_2DAYS_PAYMENT;
private static final EnumNames<FallbackType> NAMES = EnumNames.of(FallbackType.class);
/**
* Obtains an instance from the specified name.
* <p>
* Parsing handles the mixed case form produced by {@link #toString()} and
* the upper and lower case variants of the enum constant name.
*
* @param name the name to parse
* @return the fallback type
* @throws IllegalArgumentException if the name is not known
*/
@FromString
public static FallbackType of(String name) {
return NAMES.parse(name);
}
/**
* Returns the formatted string with the type's name.
*
* @return the string
*/
@ToString
@Override
public String toString() {
return NAMES.format(this);
}
}