1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 package ohos.devtools.datasources.databases.datatable.enties; 17 18 import java.util.Arrays; 19 20 /** 21 * UserData 22 * 23 * @since 2021/10/22 24 */ 25 public class UserData { 26 byte[] bytes; 27 private long localSessionId; 28 private int sessionId; 29 private long timeStamp; 30 31 /** 32 * Get session 33 * 34 * @return long 35 */ getSession()36 public long getSession() { 37 return localSessionId; 38 } 39 40 /** 41 * Get sessionId 42 * 43 * @return int 44 */ getSessionId()45 public int getSessionId() { 46 return sessionId; 47 } 48 49 /** 50 * Save session 51 * 52 * @param localSessionId Local sessionId 53 */ setSession(long localSessionId)54 public void setSession(long localSessionId) { 55 this.localSessionId = localSessionId; 56 } 57 58 /** 59 * Set sessionId 60 * 61 * @param sessionId sessionId 62 */ setSessionId(int sessionId)63 public void setSessionId(int sessionId) { 64 this.sessionId = sessionId; 65 } 66 67 /** 68 * get local sessionId 69 * 70 * @return long 71 */ getLocalSessionId()72 public long getLocalSessionId() { 73 return localSessionId; 74 } 75 76 /** 77 * Set local sessionId 78 * 79 * @param localSessionId Local sessionId 80 */ setLocalSessionId(long localSessionId)81 public void setLocalSessionId(long localSessionId) { 82 this.localSessionId = localSessionId; 83 } 84 85 /** 86 * Get time stamp 87 * 88 * @return long 89 */ getTimeStamp()90 public long getTimeStamp() { 91 return timeStamp; 92 } 93 94 /** 95 * Set time stamp 96 * 97 * @param timeStamp Time stamp 98 */ setTimeStamp(long timeStamp)99 public void setTimeStamp(long timeStamp) { 100 this.timeStamp = timeStamp; 101 } 102 getBytes()103 public byte[] getBytes() { 104 return bytes; 105 } 106 setBytes(byte[] bytes)107 public void setBytes(byte[] bytes) { 108 this.bytes = bytes; 109 } 110 111 @Override toString()112 public String toString() { 113 return "UserData{" 114 + "bytes=" + Arrays.toString(bytes) 115 + ", localSessionId=" + localSessionId 116 + ", sessionId=" + sessionId 117 + ", timeStamp=" + timeStamp 118 + '}'; 119 } 120 } 121