public class VitamCodeHelper extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getCode(VitamCode vitamCode)
Get the vitam code
|
static VitamCode |
getFrom(ServiceName service,
DomainName domain,
String item)
Get VitamCode from Service, Domain and item values
|
static VitamCode |
getFrom(String code)
Get VitamCode from code
|
static List<VitamCode> |
getFromDomain(DomainName domain)
Get list of VitamCode from a Domain
|
static List<VitamCode> |
getFromService(ServiceName service)
Get list of VitamCode from a Service
|
static String |
getLogMessage(VitamCode vitamCode,
Object... params)
Get formatted message for Logger
|
static String |
getMessage(ServiceName service,
DomainName domain,
String item)
Get the message from the Service, Domain and item values
|
static String |
getMessage(String vitamCode)
Get the message from code
|
static String |
getMessageFromVitamCode(VitamCode vitamCode)
Get the message from vitam code
|
static String |
getParametrizedMessage(ServiceName service,
DomainName domain,
String item,
Object... params)
Get parameterized message from Service, Domain and item values
|
static String |
getParametrizedMessageFromCode(String vitamCode,
Object... params)
Get parameterized message from code
|
static String |
getParametrizedMessageFromVitamCode(VitamCode vitamCode,
Object... params)
Get parameterized message from code
|
static boolean |
isAlphanumericCode(String code)
Check if the code is alphanumeric [A-Z0-9]
|
static VitamError |
toVitamError(VitamCode vitamCode,
String description)
Transform a vitamCode to a VitamError with the given description
|
public static boolean isAlphanumericCode(String code)
code
- the code to checkpublic static VitamCode getFrom(String code)
code
- the code to get VitamCodeIllegalArgumentException
- thrown if the code is wrong format or if VitamCode associated to code does not
existspublic static VitamCode getFrom(ServiceName service, DomainName domain, String item)
service
- the servicedomain
- the domainitem
- the itemIllegalArgumentException
- thrown if one argument at least is null or if VitamCode associated to the wanted
Service, Domain and item does not existpublic static String getMessage(ServiceName service, DomainName domain, String item)
service
- the servicedomain
- the domainitem
- the itemIllegalArgumentException
- thrown if one argument at least is null or if VitamCode (and the message)
associated to the wanted Service, Domain and item does not existpublic static String getMessageFromVitamCode(VitamCode vitamCode)
vitamCode
- the codeIllegalArgumentException
- thrown if vitamCode is null or if VitamCode (and the message) associated to the
wanted code does not existpublic static String getMessage(String vitamCode)
vitamCode
- the codeIllegalArgumentException
- thrown if vitamCode is null or if VitamCode (and the message) associated to the
wanted code does not existpublic static String getParametrizedMessageFromVitamCode(VitamCode vitamCode, Object... params)
vitamCode
- the codeparams
- parameters to add to messageIllegalArgumentException
- thrown if vitamCode or params is null if VitamCode (and the message) associated
to the wanted code does not existpublic static String getParametrizedMessageFromCode(String vitamCode, Object... params)
vitamCode
- the codeparams
- parameters to add to messageIllegalArgumentException
- thrown if vitamCode or params is null or if VitamCode (and the message)
associated to the wanted code does not existpublic static String getParametrizedMessage(ServiceName service, DomainName domain, String item, Object... params)
service
- the servicedomain
- the domainitem
- the itemparams
- the parametersIllegalArgumentException
- thrown if one argument at least is null or if VitamCode (and the message)
associated to the wanted code does not existpublic static List<VitamCode> getFromDomain(DomainName domain)
domain
- the domainIllegalArgumentException
- thrown if domain is nullpublic static List<VitamCode> getFromService(ServiceName service)
service
- the serviceIllegalArgumentException
- thrown if service is nullpublic static String getCode(VitamCode vitamCode)
vitamCode
- to getpublic static String getLogMessage(VitamCode vitamCode, Object... params)
vitamCode
- the Vitam codeparams
- parameters for the messageIllegalArgumentException
- thrown if vitamCodepublic static VitamError toVitamError(VitamCode vitamCode, String description)
vitamCode
- the vitamCodedescription
- the descriptionCopyright © 2018 Vitam. All rights reserved.