Examples of ItemStateData


Examples of io.fathom.cloud.protobuf.CloudCommons.ItemStateData

    }

    static final Map<Descriptor, ClassState> classes = Maps.newHashMap();

    public static <T extends GeneratedMessage> boolean isDeleted(T msg) {
        ItemStateData itemState = getItemState(msg);
        if (itemState == null) {
            return false;
        }
        return itemState.hasDeletedAt();
    }
View Full Code Here

Examples of io.fathom.cloud.protobuf.CloudCommons.ItemStateData

        FieldDescriptor field = findItemStateField(msg.getDescriptorForType());
        if (field == null) {
            throw new IllegalStateException();
        }

        ItemStateData itemStateData;
        try {
            itemStateData = (ItemStateData) builder.getField(field);
        } catch (Exception e) {
            throw new IllegalArgumentException("Error reading item state field", e);
        }

        if (itemStateData.hasDeletedAt()) {
            throw new IllegalStateException();
        }

        ItemStateData.Builder b = ItemStateData.newBuilder(itemStateData);
        b.setDeletedAt(Clock.getTimestamp());
View Full Code Here

Examples of io.fathom.cloud.protobuf.CloudCommons.ItemStateData

    public static void setUpdatedAt(Builder item) {
        Descriptor descriptor = item.getDescriptorForType();
        Optional<FieldDescriptor> itemStateField = getClassState(descriptor).getItemStateField();
        if (itemStateField.isPresent()) {
            ItemStateData itemStateData;
            try {
                itemStateData = (ItemStateData) item.getField(itemStateField.get());
            } catch (Exception e) {
                throw new IllegalArgumentException("Error reading item state field", e);
            }
View Full Code Here

Examples of io.fathom.cloud.protobuf.CloudCommons.ItemStateData

    public static void setCreatedAt(Builder item) {
        Descriptor descriptor = item.getDescriptorForType();
        Optional<FieldDescriptor> itemStateField = getClassState(descriptor).getItemStateField();
        if (itemStateField.isPresent()) {
            ItemStateData itemStateData;
            try {
                itemStateData = (ItemStateData) item.getField(itemStateField.get());
            } catch (Exception e) {
                throw new IllegalArgumentException("Error reading item state field", e);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.