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

org.cloudfoundry.client.lib.adapters.RawCloudServiceOffering Maven / Gradle / Ivy

The newest version!
package org.cloudfoundry.client.lib.adapters;

import java.util.List;

import org.cloudfoundry.client.lib.domain.CloudServiceOffering;
import org.cloudfoundry.client.lib.domain.CloudServicePlan;
import org.cloudfoundry.client.lib.domain.Derivable;
import org.cloudfoundry.client.lib.domain.ImmutableCloudServiceOffering;
import org.cloudfoundry.client.v2.Resource;
import org.cloudfoundry.client.v2.services.ServiceEntity;
import org.immutables.value.Value;

@Value.Immutable
public abstract class RawCloudServiceOffering extends RawCloudEntity {

    public abstract Resource getResource();

    public abstract List> getServicePlans();

    @Override
    public CloudServiceOffering derive() {
        Resource resource = getResource();
        ServiceEntity entity = resource.getEntity();
        return ImmutableCloudServiceOffering.builder()
                                            .metadata(parseResourceMetadata(resource))
                                            .name(entity.getLabel())
                                            .isActive(entity.getActive())
                                            .isBindable(entity.getBindable())
                                            .description(entity.getDescription())
                                            .extra(entity.getExtra())
                                            .docUrl(entity.getDocumentationUrl())
                                            .infoUrl(entity.getInfoUrl())
                                            .version(entity.getVersion())
                                            .provider(entity.getProvider())
                                            .brokerName(entity.getServiceBrokerName())
                                            .uniqueId(entity.getUniqueId())
                                            .url(entity.getUrl())
                                            .servicePlans(derive(getServicePlans()))
                                            .build();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy