All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.adorsys.datasafe.rest.impl.dto.Util Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy