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

com.huaweicloud.sdk.iotanalytics.v1.model.GetPropertyRequest Maven / Gradle / Ivy

There is a newer version: 3.1.114
Show newest version
package com.huaweicloud.sdk.iotanalytics.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * 查询属性值请求
 */
public class GetPropertyRequest {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "tags")

    private Map tags = null;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "property_names")

    private List propertyNames = null;

    public GetPropertyRequest withTags(Map tags) {
        this.tags = tags;
        return this;
    }

    public GetPropertyRequest putTagsItem(String key, String tagsItem) {
        if (this.tags == null) {
            this.tags = new HashMap<>();
        }
        this.tags.put(key, tagsItem);
        return this;
    }

    public GetPropertyRequest withTags(Consumer> tagsSetter) {
        if (this.tags == null) {
            this.tags = new HashMap<>();
        }
        tagsSetter.accept(this.tags);
        return this;
    }

    /**
     * 对property按指定tags标签进行过滤查询,填入设备标签与标签值,不可为空,例如 {\"deviceId\": \"id0001\"}
     * @return tags
     */
    public Map getTags() {
        return tags;
    }

    public void setTags(Map tags) {
        this.tags = tags;
    }

    public GetPropertyRequest withPropertyNames(List propertyNames) {
        this.propertyNames = propertyNames;
        return this;
    }

    public GetPropertyRequest addPropertyNamesItem(String propertyNamesItem) {
        if (this.propertyNames == null) {
            this.propertyNames = new ArrayList<>();
        }
        this.propertyNames.add(propertyNamesItem);
        return this;
    }

    public GetPropertyRequest withPropertyNames(Consumer> propertyNamesSetter) {
        if (this.propertyNames == null) {
            this.propertyNames = new ArrayList<>();
        }
        propertyNamesSetter.accept(this.propertyNames);
        return this;
    }

    /**
     * 查询设备的属性名称
     * @return propertyNames
     */
    public List getPropertyNames() {
        return propertyNames;
    }

    public void setPropertyNames(List propertyNames) {
        this.propertyNames = propertyNames;
    }

    @Override
    public boolean equals(java.lang.Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        GetPropertyRequest that = (GetPropertyRequest) obj;
        return Objects.equals(this.tags, that.tags) && Objects.equals(this.propertyNames, that.propertyNames);
    }

    @Override
    public int hashCode() {
        return Objects.hash(tags, propertyNames);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class GetPropertyRequest {\n");
        sb.append("    tags: ").append(toIndentedString(tags)).append("\n");
        sb.append("    propertyNames: ").append(toIndentedString(propertyNames)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy