org.cloudfoundry.client.lib.adapters.RawCloudSpace 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.CloudOrganization;
import org.cloudfoundry.client.lib.domain.CloudSpace;
import org.cloudfoundry.client.lib.domain.Derivable;
import org.cloudfoundry.client.lib.domain.ImmutableCloudSpace;
import org.cloudfoundry.client.lib.domain.annotation.Nullable;
import org.cloudfoundry.client.v2.Resource;
import org.cloudfoundry.client.v2.spaces.SpaceEntity;
import org.immutables.value.Value;
@Value.Immutable
public abstract class RawCloudSpace extends RawCloudEntity {
@Value.Parameter
public abstract Resource getResource();
@Nullable
public abstract Derivable getOrganization();
@Override
public CloudSpace derive() {
Resource resource = getResource();
SpaceEntity entity = resource.getEntity();
return ImmutableCloudSpace.builder()
.metadata(parseResourceMetadata(resource))
.name(entity.getName())
.organization(deriveFromNullable(getOrganization()))
.build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy