Package io.mangoo.routing.bindings
Class Flash
- java.lang.Object
-
- io.mangoo.routing.bindings.Flash
-
public class Flash extends Object
- Author:
- svenkubiak
-
-
Constructor Summary
Constructors Constructor Description Flash()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Flashcreate()Stringget(String key)Retrieves a specific value from the flashMap<String,String>getValues()booleanhasContent()voidinvalidate()Invalidates the flash by sending expiring the client cookiebooleanisDiscard()booleanisInvalid()voidput(String key, String value)Adds a value with a specific key to the flash overwriting an existing valueFlashsetDiscard(boolean discard)voidsetError(String value)Sets a specific error message available with the key 'error'voidsetSuccess(String value)Sets a specific success message available with the key 'success'voidsetWarning(String value)Sets a specific warning message available with the key 'warning'FlashwithContent(Map<String,String> values)
-
-
-
Method Detail
-
create
public static Flash create()
-
setError
public void setError(String value)
Sets a specific error message available with the key 'error'- Parameters:
value- The message
-
setWarning
public void setWarning(String value)
Sets a specific warning message available with the key 'warning'- Parameters:
value- The message
-
setSuccess
public void setSuccess(String value)
Sets a specific success message available with the key 'success'- Parameters:
value- The message
-
put
public void put(String key, String value)
Adds a value with a specific key to the flash overwriting an existing value- Parameters:
key- The keyvalue- The value
-
invalidate
public void invalidate()
Invalidates the flash by sending expiring the client cookie
-
get
public String get(String key)
Retrieves a specific value from the flash- Parameters:
key- The key- Returns:
- The value or null if not found
-
isDiscard
public boolean isDiscard()
-
isInvalid
public boolean isInvalid()
-
setDiscard
public Flash setDiscard(boolean discard)
-
hasContent
public boolean hasContent()
-
-