org.omnaest.utils.assertion
Class AssertLogger.LoglevelImpl

java.lang.Object
  extended by org.omnaest.utils.assertion.AssertLogger.LoglevelImpl
All Implemented Interfaces:
Serializable, AssertLogger.Loglevel, AssertLogger.LoglevelAssert
Enclosing class:
AssertLogger

protected static class AssertLogger.LoglevelImpl
extends Object
implements AssertLogger.Loglevel, AssertLogger.LoglevelAssert

Implementation for AssertLogger.Loglevel and AssertLogger.LoglevelAssert

Author:
Omnaest
See Also:
Serialized Form

Nested Class Summary
static interface AssertLogger.LoglevelImpl.LoglevelSupport
          Necessarily supported operations for a AssertLogger.Loglevel
 
Constructor Summary
protected AssertLogger.LoglevelImpl(AssertLogger.LoglevelImpl.LoglevelSupport loglevelSupport)
           
 
Method Summary
 boolean areEqual(Object object1, Object object2)
          Returns true if the given Objects are equal
 boolean areEqual(Object object1, Object object2, String message)
          Returns true if the given Objects are equal
 AssertLogger.LoglevelAssert assertThat()
          Returns a AssertLogger.LoglevelAssert instance
 void fails()
           
 void fails(Exception cause)
           
 void fails(String message)
           
 void fails(String message, Exception cause)
           
 boolean isFalse(boolean expression)
          Returns true if the given expression is false
 boolean isFalse(boolean expression, String message)
          Returns true if the given expression is false
 boolean isInterimTimeLowerThan(int durationLimit, TimeUnit timeUnit, DurationCapture durationCapture, Object[] intervalKeys)
          Returns true if the DurationCapture.getInterimTime(TimeUnit) is lower than the given duration limit.
 boolean isNotEmpty(Collection<?> collection)
          Returns true if the given Collections is not null and not empty.
 boolean isNotEmpty(Collection<?> collection, String message)
          Returns true if the given Collections is not null and not empty.
 boolean isNotNull(Object object)
          Returns true if the given Object is not null.
 boolean isNotNull(Object object, Object... objects)
          Returns true if all the given Objects are not null.
 boolean isNotNull(Object object, String message)
          Returns true if all the given Objects are not null.
 boolean isNotNull(String message, Object object, Object... objects)
          Returns true if all the given Objects are not null.
 boolean isTrue(boolean expression)
          Returns true if the given expression is true
 boolean isTrue(boolean expression, String message)
          Returns true if the given expression is true
 AssertLogger.Loglevel message(AssertLogger.MessageFactory messageFactory)
          Writes a message to the Logger using the selected AssertLogger.Loglevel

The AssertLogger.MessageFactory.message() method is only invoked if the respective AssertLogger.Loglevel is set to true within the logging configuration.
 AssertLogger.Loglevel message(AssertLogger.MessageFactory messageFactory, Throwable e)
          Writes a message and a given Throwable to the Logger using the selected AssertLogger.Loglevel.
 AssertLogger.Loglevel message(String message)
          Writes a message to the Logger using the selected AssertLogger.Loglevel
 AssertLogger.Loglevel message(String message, Throwable e)
          Writes a message and a given Throwable to the Logger using the selected AssertLogger.Loglevel
 AssertLogger.Loglevel message(Throwable e)
          Writes the stacktracke of a given Throwable to the Logger using the selected AssertLogger.Loglevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssertLogger.LoglevelImpl

protected AssertLogger.LoglevelImpl(AssertLogger.LoglevelImpl.LoglevelSupport loglevelSupport)
Parameters:
lomessage -
See Also:
AssertLogger.Loglevel
Method Detail

message

public AssertLogger.Loglevel message(String message)
Description copied from interface: AssertLogger.Loglevel
Writes a message to the Logger using the selected AssertLogger.Loglevel

Specified by:
message in interface AssertLogger.Loglevel
Returns:
AssertLogger.Loglevel

message

public AssertLogger.Loglevel message(String message,
                                     Throwable e)
Description copied from interface: AssertLogger.Loglevel
Writes a message and a given Throwable to the Logger using the selected AssertLogger.Loglevel

Specified by:
message in interface AssertLogger.Loglevel
e - Throwable
Returns:
AssertLogger.Loglevel

message

public AssertLogger.Loglevel message(Throwable e)
Description copied from interface: AssertLogger.Loglevel
Writes the stacktracke of a given Throwable to the Logger using the selected AssertLogger.Loglevel

Specified by:
message in interface AssertLogger.Loglevel
Parameters:
e - Throwable
Returns:
AssertLogger.Loglevel

message

public AssertLogger.Loglevel message(AssertLogger.MessageFactory messageFactory)
Description copied from interface: AssertLogger.Loglevel
Writes a message to the Logger using the selected AssertLogger.Loglevel

The AssertLogger.MessageFactory.message() method is only invoked if the respective AssertLogger.Loglevel is set to true within the logging configuration.

Specified by:
message in interface AssertLogger.Loglevel
Parameters:
messageFactory - AssertLogger.MessageFactory
Returns:
AssertLogger.Loglevel

message

public AssertLogger.Loglevel message(AssertLogger.MessageFactory messageFactory,
                                     Throwable e)
Description copied from interface: AssertLogger.Loglevel
Writes a message and a given Throwable to the Logger using the selected AssertLogger.Loglevel.

The AssertLogger.MessageFactory.message() method is only invoked if the respective AssertLogger.Loglevel is set to true within the logging configuration.

Specified by:
message in interface AssertLogger.Loglevel
Parameters:
messageFactory - AssertLogger.MessageFactory
e - Throwable
Returns:
AssertLogger.Loglevel

isTrue

public boolean isTrue(boolean expression)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the given expression is true

Specified by:
isTrue in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isTrue(boolean), AssertLogger.LoglevelAssert

isTrue

public boolean isTrue(boolean expression,
                      String message)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the given expression is true

Specified by:
isTrue in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isTrue(boolean, String), AssertLogger.LoglevelAssert

isFalse

public boolean isFalse(boolean expression)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the given expression is false

Specified by:
isFalse in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isFalse(boolean), AssertLogger.LoglevelAssert

isFalse

public boolean isFalse(boolean expression,
                       String message)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the given expression is false

Specified by:
isFalse in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isFalse(boolean, String), AssertLogger.LoglevelAssert

areEqual

public boolean areEqual(Object object1,
                        Object object2)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the given Objects are equal

Specified by:
areEqual in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.areEqual(Object, Object), AssertLogger.LoglevelAssert

areEqual

public boolean areEqual(Object object1,
                        Object object2,
                        String message)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the given Objects are equal

Specified by:
areEqual in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.areEqual(Object, Object, String), AssertLogger.LoglevelAssert

isNotEmpty

public boolean isNotEmpty(Collection<?> collection)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the given Collections is not null and not empty.

Specified by:
isNotEmpty in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isNotEmpty(Collection), AssertLogger.LoglevelAssert

isNotEmpty

public boolean isNotEmpty(Collection<?> collection,
                          String message)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the given Collections is not null and not empty.

Specified by:
isNotEmpty in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isNotEmpty(Collection, String), AssertLogger.LoglevelAssert

isNotNull

public boolean isNotNull(Object object)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the given Object is not null.

Specified by:
isNotNull in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isNotNull(Object), AssertLogger.LoglevelAssert

isNotNull

public boolean isNotNull(Object object,
                         Object... objects)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if all the given Objects are not null.

Specified by:
isNotNull in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isNotNull(Object, Object...), AssertLogger.LoglevelAssert

isNotNull

public boolean isNotNull(Object object,
                         String message)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if all the given Objects are not null.

Specified by:
isNotNull in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isNotNull(Object, String), AssertLogger.LoglevelAssert

isNotNull

public boolean isNotNull(String message,
                         Object object,
                         Object... objects)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if all the given Objects are not null.

Specified by:
isNotNull in interface AssertLogger.LoglevelAssert
Returns:
See Also:
Assert.isNotNull(String, Object, Object, Object...), AssertLogger.LoglevelAssert

fails

public void fails()
Specified by:
fails in interface AssertLogger.LoglevelAssert
See Also:
Assert.fails(), AssertLogger.LoglevelAssert

fails

public void fails(Exception cause)
Specified by:
fails in interface AssertLogger.LoglevelAssert
See Also:
Assert.fails(Exception), AssertLogger.LoglevelAssert

fails

public void fails(String message)
Specified by:
fails in interface AssertLogger.LoglevelAssert
See Also:
Assert.fails(), AssertLogger.LoglevelAssert

fails

public void fails(String message,
                  Exception cause)
Specified by:
fails in interface AssertLogger.LoglevelAssert
See Also:
Assert.fails(), AssertLogger.LoglevelAssert

isInterimTimeLowerThan

public boolean isInterimTimeLowerThan(int durationLimit,
                                      TimeUnit timeUnit,
                                      DurationCapture durationCapture,
                                      Object[] intervalKeys)
Description copied from interface: AssertLogger.LoglevelAssert
Returns true if the DurationCapture.getInterimTime(TimeUnit) is lower than the given duration limit.

Specified by:
isInterimTimeLowerThan in interface AssertLogger.LoglevelAssert
timeUnit - TimeUnit
durationCapture - DurationCapture
Returns:
See Also:
Assert.isInterimTimeLowerThan(int, TimeUnit, DurationCapture, Object[]), AssertLogger.LoglevelAssert

assertThat

public AssertLogger.LoglevelAssert assertThat()
Description copied from interface: AssertLogger.Loglevel
Returns a AssertLogger.LoglevelAssert instance

Specified by:
assertThat in interface AssertLogger.Loglevel
Returns:


Copyright © 2013. All Rights Reserved.