Skip to content

Commit

Permalink
Restyled by google-java-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Feb 16, 2024
1 parent 53d12e5 commit 7e74eb2
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,36 @@

public class Message {

public class PriorityType {
int priority;
public PriorityType(int priority)
{
this.priority = priority;
}
public class PriorityType {
int priority;

public PriorityType(int priority) {
this.priority = priority;
}
}

public String messageId;
public PriorityType priority;
public int messageControl;
public long startTime;
public int duration;
public String messageText;
public Vector<MessageResponseOption> responseOptions;
public String messageId;
public PriorityType priority;
public int messageControl;
public long startTime;
public int duration;
public String messageText;
public Vector<MessageResponseOption> responseOptions;

public Message(String messageId,
PriorityType priority,
int messageControl,
long startTime,
int duration,
String messageText,
Vector<MessageResponseOption> responseOptions)
{
this.messageId = messageId;
this.priority = priority;
this.messageControl = messageControl;
this.startTime = startTime;
this.duration = duration;
this.messageText = messageText;
this.responseOptions = responseOptions;
}
public Message(
String messageId,
PriorityType priority,
int messageControl,
long startTime,
int duration,
String messageText,
Vector<MessageResponseOption> responseOptions) {
this.messageId = messageId;
this.priority = priority;
this.messageControl = messageControl;
this.startTime = startTime;
this.duration = duration;
this.messageText = messageText;
this.responseOptions = responseOptions;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
package com.matter.tv.server.tvapp;

public class MessageResponseOption {
public long id;
public String label;
public long id;
public String label;

public MessageResponseOption(
long id,
String label) {
this.id = id;
this.label = label;
}
public MessageResponseOption(long id, String label) {
this.id = id;
this.label = label;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
Expand All @@ -17,20 +17,21 @@
*/
package com.matter.tv.server.tvapp;

import java.util.Vector;
import com.matter.tv.server.tvapp.Message.PriorityType;
import java.util.Vector;

public interface MessagesManager {

Message[] getMessages();
Message[] getMessages();

boolean presentMessages(String messageId,
PriorityType priority,
int messageControl,
long startTime,
int duration,
String messageText,
Vector<MessageResponseOption> responseOptions);
boolean presentMessages(
String messageId,
PriorityType priority,
int messageControl,
long startTime,
int duration,
String messageText,
Vector<MessageResponseOption> responseOptions);

boolean cancelMessage(String messageId);
boolean cancelMessage(String messageId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
package com.matter.tv.server.tvapp;

import android.util.Log;
import com.matter.tv.server.tvapp.Message.PriorityType;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;

import com.matter.tv.server.tvapp.Message.PriorityType;

public class MessagesManagerStub implements MessagesManager {
private static final String TAG = MessagesManagerStub.class.getSimpleName();

private int endpoint;

private Map<String,Message> messages = new HashMap<String,Message>();
private Map<String, Message> messages = new HashMap<String, Message>();

public MessagesManagerStub(int endpoint) {
this.endpoint = endpoint;
Expand All @@ -43,30 +42,33 @@ public Message[] getMessages() {
}

@Override
public boolean presentMessages(String messageId,
PriorityType priority,
int messageControl,
long startTime,
int duration,
String messageText,
Vector<MessageResponseOption> responseOptions) {
Log.d(TAG, "presentMessages: at " + this.endpoint + " id:" + messageId+ " text:"+messageText);
messages.put(messageId, new Message(messageId,
public boolean presentMessages(
String messageId,
PriorityType priority,
int messageControl,
long startTime,
int duration,
String messageText,
Vector<MessageResponseOption> responseOptions) {
Log.d(
TAG, "presentMessages: at " + this.endpoint + " id:" + messageId + " text:" + messageText);
messages.put(
messageId,
new Message(
messageId,
priority,
messageControl,
startTime,
duration,
messageText,
responseOptions));
return true;
}
return true;
}

@Override
public boolean cancelMessage(String messageId)
{
Log.d(TAG, "cancelMessage: at " + this.endpoint + " messageId:"+messageId);
public boolean cancelMessage(String messageId) {
Log.d(TAG, "cancelMessage: at " + this.endpoint + " messageId:" + messageId);
messages.remove(messageId);
return true; // per spec, succeed unless error
}

}

0 comments on commit 7e74eb2

Please sign in to comment.