de.adorsys.datasafe.rest.impl.dto.Util Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datasafe-rest-impl Show documentation
Show all versions of datasafe-rest-impl Show documentation
Spring Boot DataSafe Application
package de.adorsys.datasafe.rest.impl.dto;
import de.adorsys.datasafe.types.api.resource.AbsoluteLocation;
import de.adorsys.datasafe.types.api.resource.BasePrivateResource;
import de.adorsys.datasafe.types.api.resource.BasePublicResource;
import de.adorsys.datasafe.types.api.resource.PrivateResource;
import de.adorsys.datasafe.types.api.resource.PublicResource;
import lombok.experimental.UtilityClass;
@UtilityClass
public class Util {
public String str(AbsoluteLocation resource) {
if (null == resource || null == resource.location()) {
return null;
}
return resource.location().asString();
}
public AbsoluteLocation privateResource(String str) {
if (null == str) {
return null;
}
return BasePrivateResource.forAbsolutePrivate(str);
}
public AbsoluteLocation publicResource(String str) {
if (null == str) {
return null;
}
return BasePublicResource.forAbsolutePublic(str);
}
}