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

com.alicloud.openservices.tablestore.model.timeseries.AttributeMetaQueryCondition Maven / Gradle / Ivy

Go to download

Aliyun Open Services SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com

There is a newer version: 5.17.6
Show newest version
package com.alicloud.openservices.tablestore.model.timeseries;

import com.alicloud.openservices.tablestore.core.protocol.timeseries.Timeseries;
import com.alicloud.openservices.tablestore.core.utils.Preconditions;
import com.google.protobuf.ByteString;

public class AttributeMetaQueryCondition implements MetaQueryCondition {

    private final MetaQuerySingleOperator operator;
    private final String attributeName;
    private final String value;

    public AttributeMetaQueryCondition(MetaQuerySingleOperator operator, String attributeName, String value) {
        Preconditions.checkNotNull(operator);
        Preconditions.checkStringNotNullAndEmpty(attributeName, "tag name should not be null or empty");
        Preconditions.checkNotNull(value);
        this.operator = operator;
        this.attributeName = attributeName;
        this.value = value;
    }

    @Override
    public Timeseries.MetaQueryConditionType getType() {
        return Timeseries.MetaQueryConditionType.ATTRIBUTE_CONDITION;
    }

    @Override
    public ByteString serialize() {
        return Timeseries.MetaQueryAttributeCondition.newBuilder()
                .setOp(operator.toPB())
                .setAttrName(attributeName)
                .setValue(value)
                .build()
                .toByteString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy