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 Jun 22, 2022
1 parent 4fb736a commit bb4d018
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,12 @@ public static void loadJni() {
return;
}

/**
* Returns a new {@link ChipDeviceController} with default parameters.
*/
/** Returns a new {@link ChipDeviceController} with default parameters. */
public ChipDeviceController() {
this(ControllerParams.newBuilder().build());
}

/**
* Returns a new {@link ChipDeviceController} with the specified parameters.
*/
/** Returns a new {@link ChipDeviceController} with the specified parameters. */
public ChipDeviceController(ControllerParams params) {
deviceControllerPtr = newDeviceController(params);
}
Expand Down
51 changes: 16 additions & 35 deletions src/controller/java/src/chip/devicecontroller/ControllerParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,19 @@

import androidx.annotation.Nullable;

/**
* Parameters representing initialization arguments for {@link ChipDeviceController}.
*/
/** Parameters representing initialization arguments for {@link ChipDeviceController}. */
public final class ControllerParams {

private final int udpListenPort;
@Nullable
private final KeypairDelegate keypairDelegate;
@Nullable
private final byte[] rootCertificate;
@Nullable
private final byte[] intermediateCertificate;
@Nullable
private final byte[] operationalCertificate;
@Nullable
private final byte[] ipk;
@Nullable private final KeypairDelegate keypairDelegate;
@Nullable private final byte[] rootCertificate;
@Nullable private final byte[] intermediateCertificate;
@Nullable private final byte[] operationalCertificate;
@Nullable private final byte[] ipk;

private static final int LEGACY_GLOBAL_CHIP_PORT = 5540;

/**
* @param udpListenPort the UDP listening port, or 0 to pick any available port.
*/
/** @param udpListenPort the UDP listening port, or 0 to pick any available port. */
private ControllerParams(Builder builder) {
this.udpListenPort = builder.udpListenPort;
this.keypairDelegate = builder.keypairDelegate;
Expand All @@ -33,9 +24,7 @@ private ControllerParams(Builder builder) {
this.ipk = builder.ipk;
}

/**
* Gets the UDP listening port; 0 indicates "any available port"
*/
/** Gets the UDP listening port; 0 indicates "any available port" */
public int getUdpListenPort() {
return udpListenPort;
}
Expand All @@ -60,9 +49,7 @@ public byte[] getIpk() {
return ipk;
}

/**
* Returns parameters with ephemerally generated operational credentials
*/
/** Returns parameters with ephemerally generated operational credentials */
public static Builder newBuilder() {
return new Builder();
}
Expand All @@ -83,19 +70,13 @@ public static Builder newBuilder(OperationalKeyConfig operationalKeyConfig) {
/** Builder for {@link ControllerParams}. */
public static class Builder {
private int udpListenPort = LEGACY_GLOBAL_CHIP_PORT + 1;
@Nullable
private KeypairDelegate keypairDelegate = null;
@Nullable
private byte[] rootCertificate = null;
@Nullable
private byte[] intermediateCertificate = null;
@Nullable
private byte[] operationalCertificate = null;
@Nullable
private byte[] ipk = null;

private Builder() {
}
@Nullable private KeypairDelegate keypairDelegate = null;
@Nullable private byte[] rootCertificate = null;
@Nullable private byte[] intermediateCertificate = null;
@Nullable private byte[] operationalCertificate = null;
@Nullable private byte[] ipk = null;

private Builder() {}

public Builder setUdpListenPort(int udpListenPort) {
if (udpListenPort < 0) {
Expand Down

0 comments on commit bb4d018

Please sign in to comment.