001// --------------------------------------------------------------------------------
002// Copyright 2002-2025 Echo Three, LLC
003//
004// Licensed under the Apache License, Version 2.0 (the "License");
005// you may not use this file except in compliance with the License.
006// You may obtain a copy of the License at
007//
008//     http://www.apache.org/licenses/LICENSE-2.0
009//
010// Unless required by applicable law or agreed to in writing, software
011// distributed under the License is distributed on an "AS IS" BASIS,
012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013// See the License for the specific language governing permissions and
014// limitations under the License.
015// --------------------------------------------------------------------------------
016
017package com.echothree.model.control.search.server.graphql;
018
019import com.echothree.model.control.core.server.graphql.CoreSecurityUtils;
020import com.echothree.model.control.core.server.graphql.EntityIntegerRangeObject;
021import com.echothree.model.data.core.server.entity.EntityIntegerRange;
022import graphql.annotations.annotationTypes.GraphQLDescription;
023import graphql.annotations.annotationTypes.GraphQLField;
024import graphql.annotations.annotationTypes.GraphQLName;
025import graphql.annotations.annotationTypes.GraphQLNonNull;
026import graphql.schema.DataFetchingEnvironment;
027
028@GraphQLDescription("user visit search facet integer object")
029@GraphQLName("UserVisitSearchFacetInteger")
030public class UserVisitSearchFacetIntegerObject {
031
032    final private EntityIntegerRange entityIntegerRange;
033    private Long count;
034
035    /** Creates a new instance of UserVisitSearchFacetIntegerObject */
036    public UserVisitSearchFacetIntegerObject(EntityIntegerRange entityIntegerRange, Long count) {
037        this.entityIntegerRange = entityIntegerRange;
038        this.count = count;
039    }
040
041    public EntityIntegerRange getEntityIntegerRange() {
042        return entityIntegerRange;
043    }
044
045    @GraphQLField
046    @GraphQLDescription("entity integer range")
047    @GraphQLNonNull
048    public EntityIntegerRangeObject getEntityIntegerRange(final DataFetchingEnvironment env) {
049        return CoreSecurityUtils.getHasEntityIntegerRangeAccess(env) ? new EntityIntegerRangeObject(entityIntegerRange) : null;
050    }
051
052    public void setCount(Long count) {
053        this.count = count;
054    }
055
056    @GraphQLField
057    @GraphQLDescription("count")
058    @GraphQLNonNull
059    public Long getCount() {
060        return count;
061    }
062
063}