org.cloudfoundry.client.lib.adapters.RawCloudServiceKey Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudfoundry-client-lib Show documentation
Show all versions of cloudfoundry-client-lib Show documentation
A Cloud Foundry client library for Java
The newest version!
package org.cloudfoundry.client.lib.adapters;
import org.cloudfoundry.client.lib.domain.CloudServiceInstance;
import org.cloudfoundry.client.lib.domain.CloudServiceKey;
import org.cloudfoundry.client.lib.domain.Derivable;
import org.cloudfoundry.client.lib.domain.ImmutableCloudServiceKey;
import org.cloudfoundry.client.v2.Resource;
import org.cloudfoundry.client.v2.servicekeys.ServiceKeyEntity;
import org.immutables.value.Value;
@Value.Immutable
public abstract class RawCloudServiceKey extends RawCloudEntity {
public abstract Resource getResource();
public abstract Derivable getServiceInstance();
@Override
public CloudServiceKey derive() {
Resource resource = getResource();
ServiceKeyEntity entity = resource.getEntity();
return ImmutableCloudServiceKey.builder()
.metadata(parseResourceMetadata(resource))
.name(entity.getName())
.serviceInstance(getServiceInstance().derive())
.credentials(entity.getCredentials())
.build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy