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

com.sap.cloud.alert.notification.client.builder.AffectedCustomerResourceBuilder Maven / Gradle / Ivy

Go to download

Means for out-of-the-box events management in SAP Alert Notification service for SAP BTP service.

There is a newer version: 1.11.0
Show newest version
package com.sap.cloud.alert.notification.client.builder;

import com.sap.cloud.alert.notification.client.model.AffectedCustomerResource;

import java.util.HashMap;
import java.util.Map;

import static java.util.Objects.requireNonNull;
import static org.apache.commons.collections4.MapUtils.emptyIfNull;

public class AffectedCustomerResourceBuilder {

    private String name;
    private String type;
    private String instance;
    private Map tags;

    public AffectedCustomerResourceBuilder() {
        this.name = null;
        this.type = null;
        this.instance = null;
        this.tags = new HashMap<>();
    }

    public AffectedCustomerResourceBuilder withName(String name) {
        this.name = name;

        return this;
    }

    public AffectedCustomerResourceBuilder withType(String type) {
        this.type = type;

        return this;
    }

    public AffectedCustomerResourceBuilder withInstance(String instance) {
        this.instance = instance;

        return this;
    }

    public AffectedCustomerResourceBuilder withTags(Map tags) {
        this.tags = new HashMap<>(emptyIfNull(tags));

        return this;
    }

    public AffectedCustomerResource build() {
        return new AffectedCustomerResource(
                requireNonNull(name),
                requireNonNull(type),
                instance,
                tags
        );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy