2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.freebox.internal.api.model;
15 import java.util.Calendar;
17 import com.google.gson.annotations.SerializedName;
20 * The {@link FreeboxCallEntry} is the Java class used to map the "CallEntry"
21 * structure used by the call API
22 * https://dev.freebox.fr/sdk/os/call/#
24 * @author Laurent Garnier - Initial contribution
26 public class FreeboxCallEntry {
27 private static final String CALL_ENTRY_TYPE_ACCEPTED = "accepted";
28 private static final String CALL_ENTRY_TYPE_MISSED = "missed";
29 private static final String CALL_ENTRY_TYPE_OUTGOING = "outgoing";
33 private long datetime;
34 private String number;
37 @SerializedName("new")
38 private boolean newCall;
39 private int contactId;
41 public Calendar getTimeStamp() {
42 Calendar c = Calendar.getInstance();
43 c.setTimeInMillis(datetime * 1000);
47 public boolean isAccepted() {
48 return CALL_ENTRY_TYPE_ACCEPTED.equalsIgnoreCase(type);
51 public boolean isMissed() {
52 return CALL_ENTRY_TYPE_MISSED.equalsIgnoreCase(type);
55 public boolean isOutGoing() {
56 return CALL_ENTRY_TYPE_OUTGOING.equalsIgnoreCase(type);
63 public String getType() {
67 public long getDatetime() {
71 public String getNumber() {
75 public String getName() {
79 public int getDuration() {
83 public boolean isNewCall() {
87 public int getContactId() {