54 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 55 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 56 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 57 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 58 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 59 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 60 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61 */ 62 package java.time.chrono; 63 64 import java.time.DateTimeException; 65 66 /** 67 * An era in the Thai Buddhist calendar system. 68 * <p> 69 * The Thai Buddhist calendar system has two eras. 70 * The current era, for years from 1 onwards, is known as the 'Buddhist' era. 71 * All previous years, zero or earlier in the proleptic count or one and greater 72 * in the year-of-era count, are part of the 'Before Buddhist' era. 73 * 74 * <table class="striped"> 75 * <caption style="display:none">Buddhist years and eras</caption> 76 * <thead> 77 * <tr> 78 * <th style="text-align:left">year-of-era</th> 79 * <th style="text-align:left">era</th> 80 * <th style="text-align:left">proleptic-year</th> 81 * <th style="text-align:left">ISO proleptic-year</th> 82 * </tr> 83 * </thead> 84 * <tbody> 85 * <tr> 86 * <td>2</td><td>BE</td><td>2</td><td>-542</td> 87 * </tr> 88 * <tr> 89 * <td>1</td><td>BE</td><td>1</td><td>-543</td> 90 * </tr> 91 * <tr> 92 * <td>1</td><td>BEFORE_BE</td><td>0</td><td>-544</td> 93 * </tr> 94 * <tr> 95 * <td>2</td><td>BEFORE_BE</td><td>-1</td><td>-545</td> 96 * </tr> 97 * </tbody> 98 * </table> 99 * <p> 100 * <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code ThaiBuddhistEra}. 101 * Use {@code getValue()} instead.</b> 102 * 103 * @implSpec 104 * This is an immutable and thread-safe enum. 105 * 106 * @since 1.8 107 */ 108 public enum ThaiBuddhistEra implements Era { 109 110 /** 111 * The singleton instance for the era before the current one, 'Before Buddhist Era', 112 * which has the numeric value 0. 113 */ 114 BEFORE_BE, 115 /** | 54 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 55 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 56 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 57 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 58 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 59 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 60 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61 */ 62 package java.time.chrono; 63 64 import java.time.DateTimeException; 65 66 /** 67 * An era in the Thai Buddhist calendar system. 68 * <p> 69 * The Thai Buddhist calendar system has two eras. 70 * The current era, for years from 1 onwards, is known as the 'Buddhist' era. 71 * All previous years, zero or earlier in the proleptic count or one and greater 72 * in the year-of-era count, are part of the 'Before Buddhist' era. 73 * 74 * <table class="striped" style="text-align:left"> 75 * <caption style="display:none">Buddhist years and eras</caption> 76 * <thead> 77 * <tr> 78 * <th scope="col">year-of-era</th> 79 * <th scope="col">era</th> 80 * <th scope="col">proleptic-year</th> 81 * <th scope="col">ISO proleptic-year</th> 82 * </tr> 83 * </thead> 84 * <tbody> 85 * <tr> 86 * <td>2</td><td>BE</td><th scope="row">2</th><td>-542</td> 87 * </tr> 88 * <tr> 89 * <td>1</td><td>BE</td><th scope="row">1</th><td>-543</td> 90 * </tr> 91 * <tr> 92 * <td>1</td><td>BEFORE_BE</td><th scope="row">0</th><td>-544</td> 93 * </tr> 94 * <tr> 95 * <td>2</td><td>BEFORE_BE</td><th scope="row">-1</th><td>-545</td> 96 * </tr> 97 * </tbody> 98 * </table> 99 * <p> 100 * <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code ThaiBuddhistEra}. 101 * Use {@code getValue()} instead.</b> 102 * 103 * @implSpec 104 * This is an immutable and thread-safe enum. 105 * 106 * @since 1.8 107 */ 108 public enum ThaiBuddhistEra implements Era { 109 110 /** 111 * The singleton instance for the era before the current one, 'Before Buddhist Era', 112 * which has the numeric value 0. 113 */ 114 BEFORE_BE, 115 /** |