Class SessionName
- java.lang.Object
-
- dev.aherscu.qa.jgiven.commons.utils.SessionName
-
public class SessionName extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SessionName.SessionNameBuilder
-
Field Summary
Fields Modifier and Type Field Description String
className
String
id
static SessionName
INVALID
An invalid session name; this might happen with a test which does not correctly set its session name, or does not care about because it does not use the WebDriver infrastructure.String
methodName
String
params
String
timestamp
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionName
asClassSession()
static SessionName.SessionNameBuilder
builder()
protected boolean
canEqual(Object other)
boolean
equals(Object o)
static SessionName
from(String name)
Parses a Web Driver session name from specified string.static String
generateFromCurrentThreadAndTime()
int
hashCode()
String
toString()
SessionName
withClassName(String className)
SessionName
withId(String id)
SessionName
withMethodName(String methodName)
SessionName
withParams(String params)
SessionName
withTimestamp(String timestamp)
-
-
-
Field Detail
-
INVALID
public static final SessionName INVALID
An invalid session name; this might happen with a test which does not correctly set its session name, or does not care about because it does not use the WebDriver infrastructure.
-
className
public final String className
-
methodName
public final String methodName
-
params
public final String params
-
id
public final String id
-
timestamp
public final String timestamp
-
-
Method Detail
-
from
public static SessionName from(String name)
Parses a Web Driver session name from specified string.- Parameters:
name
- the session name; must have 5 parts delimited by colon, following this format:class:method:paramsHash:threadId:timestamp
wherein each part is optional- Returns:
- the parsed , or
INVALID
if the name cannot be split into five parts - Throws:
NullPointerException
- if the name is null
-
generateFromCurrentThreadAndTime
public static String generateFromCurrentThreadAndTime()
-
asClassSession
public SessionName asClassSession()
- Returns:
- a session name for a class-level test; only class-name and thread id are included
-
builder
public static SessionName.SessionNameBuilder builder()
-
withClassName
public SessionName withClassName(String className)
- Returns:
- a clone of this object, except with this updated property
(returns
this
if an identical value is passed).
-
withMethodName
public SessionName withMethodName(String methodName)
- Returns:
- a clone of this object, except with this updated property
(returns
this
if an identical value is passed).
-
withParams
public SessionName withParams(String params)
- Returns:
- a clone of this object, except with this updated property
(returns
this
if an identical value is passed).
-
withId
public SessionName withId(String id)
- Returns:
- a clone of this object, except with this updated property
(returns
this
if an identical value is passed).
-
withTimestamp
public SessionName withTimestamp(String timestamp)
- Returns:
- a clone of this object, except with this updated property
(returns
this
if an identical value is passed).
-
canEqual
protected boolean canEqual(Object other)
-
-