View Javadoc
1   /*
2    * Copyright (C) 2013 4th Line GmbH, Switzerland
3    *
4    * The contents of this file are subject to the terms of either the GNU
5    * Lesser General Public License Version 2 or later ("LGPL") or the
6    * Common Development and Distribution License Version 1 or later
7    * ("CDDL") (collectively, the "License"). You may not use this file
8    * except in compliance with the License. See LICENSE.txt for more
9    * information.
10   *
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14   */
15  
16  package org.fourthline.cling.support.model;
17  
18  import org.fourthline.cling.model.types.UnsignedIntegerFourBytes;
19  
20  /**
21   * @author Alessio Gaeta
22   * @author Christian Bauer
23   */
24  public class BrowseResult {
25  
26      protected String result;
27      protected UnsignedIntegerFourBytes count;
28      protected UnsignedIntegerFourBytes totalMatches;
29      protected UnsignedIntegerFourBytes containerUpdateID;
30  
31      public BrowseResult(String result, UnsignedIntegerFourBytes count,
32                          UnsignedIntegerFourBytes totalMatches,
33                          UnsignedIntegerFourBytes containerUpdateID) {
34          this.result = result;
35          this.count = count;
36          this.totalMatches = totalMatches;
37          this.containerUpdateID = containerUpdateID;
38      }
39  
40      public BrowseResult(String result, long count, long totalMatches) {
41          this(result, count, totalMatches, 0);
42      }
43  
44      public BrowseResult(String result, long count, long totalMatches, long updatedId) {
45          this(
46                  result,
47                  new UnsignedIntegerFourBytes(count),
48                  new UnsignedIntegerFourBytes(totalMatches),
49                  new UnsignedIntegerFourBytes(updatedId)
50          );
51      }
52  
53      public String getResult() {
54          return result;
55      }
56  
57      public UnsignedIntegerFourBytes getCount() {
58          return count;
59      }
60  
61      public long getCountLong() {
62          return count.getValue();
63      }
64  
65      public UnsignedIntegerFourBytes getTotalMatches() {
66          return totalMatches;
67      }
68  
69      public long getTotalMatchesLong() {
70          return totalMatches.getValue();
71      }
72  
73      public UnsignedIntegerFourBytes getContainerUpdateID() {
74          return containerUpdateID;
75      }
76  
77      public long getContainerUpdateIDLong() {
78          return containerUpdateID.getValue();
79      }
80  
81  
82  }