String representation of the Policy modified

This commit is contained in:
Lucio Lelii 2022-03-07 16:05:26 +01:00
parent d33d86e036
commit f66c16e566
1 changed files with 13 additions and 1 deletions

View File

@ -118,7 +118,19 @@ public class PolicyAuth implements Serializable {
* Get full name
*/
public String getServiceAsString(){
return service.getServiceClass()+":"+service.getServiceName()+":"+service.getServiceId();
String serviceClass = service.getServiceClass();
String serviceName = service.getServiceName();
String serviceId = service.getServiceId();
if (serviceClass == null)
return "*";
StringBuilder toReturn = new StringBuilder(serviceClass);
if (serviceName == null)
return toReturn.append(":").append("*").toString();
toReturn.append(":").append(serviceName);
if (serviceId!=null)
toReturn.append(":").append(serviceId);
return toReturn.toString();
}
/*
* Get full name caller