001/* 002 * Copyright 2013 Box, Inc. All rights reserved. 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 */ 016package org.nuxeo.box.api.marshalling.dao; 017 018import com.fasterxml.jackson.annotation.JsonProperty; 019 020import java.util.Map; 021 022public class BoxEventCollection extends BoxCollectionBase { 023 024 public static final String FIELD_CHUNK_SIZE = "chunk_size"; 025 026 public static final String FIELD_NEXT_STREAM_POSITION = "next_stream_position"; 027 028 public BoxEventCollection() { 029 } 030 031 /** 032 * Copy constructor, this does deep copy for all the fields. 033 * 034 * @param obj 035 */ 036 public BoxEventCollection(BoxEventCollection obj) { 037 super(obj); 038 } 039 040 /** 041 * Instantiate the object from a map. Each entry in the map reflects to a field. 042 * 043 * @param map 044 */ 045 public BoxEventCollection(Map<String, Object> map) { 046 super(map); 047 } 048 049 /** 050 * @return the chunk size 051 */ 052 @JsonProperty(FIELD_CHUNK_SIZE) 053 public Integer getChunkSize() { 054 return (Integer) getValue(FIELD_CHUNK_SIZE); 055 } 056 057 /** 058 * @param chunkSize size the chunk size 059 */ 060 @JsonProperty(FIELD_CHUNK_SIZE) 061 private void setChunkSize(Integer chunkSize) { 062 put(FIELD_CHUNK_SIZE, chunkSize); 063 } 064 065 /** 066 * @return the next stream_position 067 */ 068 @JsonProperty(FIELD_NEXT_STREAM_POSITION) 069 public Long getNextStreamPosition() { 070 return (Long) getValue(FIELD_NEXT_STREAM_POSITION); 071 } 072 073 /** 074 * @param nextStreamPosition the next stream position 075 */ 076 @JsonProperty(FIELD_NEXT_STREAM_POSITION) 077 private void setNextStreamPosition(Long nextStreamPosition) { 078 put(FIELD_NEXT_STREAM_POSITION, nextStreamPosition); 079 } 080}