001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.assertions; 014 015import java.io.*; 016import java.time.*; 017import java.time.temporal.*; 018import java.util.function.*; 019 020import org.apache.juneau.internal.*; 021import org.apache.juneau.serializer.*; 022 023/** 024 * Used for assertion calls against {@link ZonedDateTime} objects. 025 * 026 * <h5 class='section'>Example:</h5> 027 * <p class='bjava'> 028 * <jc>// Validates the specified date is after the current date.</jc> 029 * <jsm>assertZonedDateTime</jsm>(<jv>myZdt</jv>).isAfterNow(); 030 * </p> 031 * 032 * 033 * <h5 class='section'>Test Methods:</h5> 034 * <p> 035 * <ul class='javatree'> 036 * <li class='jc'>{@link FluentZonedDateTimeAssertion} 037 * <ul class='javatreec'> 038 * <li class='jm'>{@link FluentZonedDateTimeAssertion#is(ZonedDateTime,ChronoUnit) is(ZonedDateTime,ChronoUnit)} 039 * <li class='jm'>{@link FluentZonedDateTimeAssertion#isAfter(ZonedDateTime) isAfter(ZonedDateTime)} 040 * <li class='jm'>{@link FluentZonedDateTimeAssertion#isAfterNow() isAfterNow()} 041 * <li class='jm'>{@link FluentZonedDateTimeAssertion#isBefore(ZonedDateTime) isBefore(ZonedDateTime)} 042 * <li class='jm'>{@link FluentZonedDateTimeAssertion#isBeforeNow() isBeforeNow()} 043 * <li class='jm'>{@link FluentZonedDateTimeAssertion#isBetween(ZonedDateTime,ZonedDateTime) isBetween(ZonedDateTime,ZonedDateTime)} 044 * </ul> 045 * <li class='jc'>{@link FluentComparableAssertion} 046 * <ul class='javatreec'> 047 * <li class='jm'>{@link FluentComparableAssertion#isGt(Comparable) isGt(Comparable)} 048 * <li class='jm'>{@link FluentComparableAssertion#isGte(Comparable) isGte(Comparable)} 049 * <li class='jm'>{@link FluentComparableAssertion#isLt(Comparable) isLt(Comparable)} 050 * <li class='jm'>{@link FluentComparableAssertion#isLte(Comparable) isLte(Comparable)} 051 * <li class='jm'>{@link FluentComparableAssertion#isBetween(Comparable,Comparable) isBetween(Comparable,Comparable)} 052 * </ul> 053 * <li class='jc'>{@link FluentObjectAssertion} 054 * <ul class='javatreec'> 055 * <li class='jm'>{@link FluentObjectAssertion#isExists() isExists()} 056 * <li class='jm'>{@link FluentObjectAssertion#is(Object) is(Object)} 057 * <li class='jm'>{@link FluentObjectAssertion#is(Predicate) is(Predicate)} 058 * <li class='jm'>{@link FluentObjectAssertion#isNot(Object) isNot(Object)} 059 * <li class='jm'>{@link FluentObjectAssertion#isAny(Object...) isAny(Object...)} 060 * <li class='jm'>{@link FluentObjectAssertion#isNotAny(Object...) isNotAny(Object...)} 061 * <li class='jm'>{@link FluentObjectAssertion#isNull() isNull()} 062 * <li class='jm'>{@link FluentObjectAssertion#isNotNull() isNotNull()} 063 * <li class='jm'>{@link FluentObjectAssertion#isString(String) isString(String)} 064 * <li class='jm'>{@link FluentObjectAssertion#isJson(String) isJson(String)} 065 * <li class='jm'>{@link FluentObjectAssertion#isSame(Object) isSame(Object)} 066 * <li class='jm'>{@link FluentObjectAssertion#isSameJsonAs(Object) isSameJsonAs(Object)} 067 * <li class='jm'>{@link FluentObjectAssertion#isSameSortedJsonAs(Object) isSameSortedJsonAs(Object)} 068 * <li class='jm'>{@link FluentObjectAssertion#isSameSerializedAs(Object, WriterSerializer) isSameSerializedAs(Object, WriterSerializer)} 069 * <li class='jm'>{@link FluentObjectAssertion#isType(Class) isType(Class)} 070 * <li class='jm'>{@link FluentObjectAssertion#isExactType(Class) isExactType(Class)} 071 * </ul> 072 * </ul> 073 * 074 * <h5 class='section'>Transform Methods:</h5> 075 * <p> 076 * <ul class='javatree'> 077 * <li class='jc'>{@link FluentObjectAssertion} 078 * <ul class='javatreec'> 079 * <li class='jm'>{@link FluentObjectAssertion#asString() asString()} 080 * <li class='jm'>{@link FluentObjectAssertion#asString(WriterSerializer) asString(WriterSerializer)} 081 * <li class='jm'>{@link FluentObjectAssertion#asString(Function) asString(Function)} 082 * <li class='jm'>{@link FluentObjectAssertion#asJson() asJson()} 083 * <li class='jm'>{@link FluentObjectAssertion#asJsonSorted() asJsonSorted()} 084 * <li class='jm'>{@link FluentObjectAssertion#asTransformed(Function) asApplied(Function)} 085 * <li class='jm'>{@link FluentObjectAssertion#asAny() asAny()} 086 * </ul> 087 * </ul> 088 * 089 * <h5 class='section'>Configuration Methods:</h5> 090 * <p> 091 * <ul class='javatree'> 092 * <li class='jc'>{@link Assertion} 093 * <ul class='javatreec'> 094 * <li class='jm'>{@link Assertion#setMsg(String, Object...) setMsg(String, Object...)} 095 * <li class='jm'>{@link Assertion#setOut(PrintStream) setOut(PrintStream)} 096 * <li class='jm'>{@link Assertion#setSilent() setSilent()} 097 * <li class='jm'>{@link Assertion#setStdOut() setStdOut()} 098 * <li class='jm'>{@link Assertion#setThrowable(Class) setThrowable(Class)} 099 * </ul> 100 * </ul> 101 * 102 * <h5 class='section'>See Also:</h5><ul> 103 * <li class='link'><a class="doclink" href="../../../../index.html#ja.Overview">Overview > juneau-assertions > Overview</a> 104 * </ul> 105 */ 106@FluentSetters(returns="ZonedDateTimeAssertion") 107public class ZonedDateTimeAssertion extends FluentZonedDateTimeAssertion<ZonedDateTimeAssertion> { 108 109 //----------------------------------------------------------------------------------------------------------------- 110 // Static 111 //----------------------------------------------------------------------------------------------------------------- 112 113 /** 114 * Static creator. 115 * 116 * @param value 117 * The object being tested. 118 * <br>Can be <jk>null</jk>. 119 * @return A new assertion object. 120 */ 121 public static ZonedDateTimeAssertion create(ZonedDateTime value) { 122 return new ZonedDateTimeAssertion(value); 123 } 124 125 //----------------------------------------------------------------------------------------------------------------- 126 // Instance 127 //----------------------------------------------------------------------------------------------------------------- 128 129 /** 130 * Constructor. 131 * 132 * @param value 133 * The object being tested. 134 * <br>Can be <jk>null</jk>. 135 */ 136 public ZonedDateTimeAssertion(ZonedDateTime value) { 137 super(value, null); 138 } 139 140 //----------------------------------------------------------------------------------------------------------------- 141 // Fluent setters 142 //----------------------------------------------------------------------------------------------------------------- 143 144 // <FluentSetters> 145 146 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 147 public ZonedDateTimeAssertion setMsg(String msg, Object...args) { 148 super.setMsg(msg, args); 149 return this; 150 } 151 152 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 153 public ZonedDateTimeAssertion setOut(PrintStream value) { 154 super.setOut(value); 155 return this; 156 } 157 158 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 159 public ZonedDateTimeAssertion setSilent() { 160 super.setSilent(); 161 return this; 162 } 163 164 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 165 public ZonedDateTimeAssertion setStdOut() { 166 super.setStdOut(); 167 return this; 168 } 169 170 @Override /* GENERATED - org.apache.juneau.assertions.Assertion */ 171 public ZonedDateTimeAssertion setThrowable(Class<? extends java.lang.RuntimeException> value) { 172 super.setThrowable(value); 173 return this; 174 } 175 176 // </FluentSetters> 177}