Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
CesarCoelho committed Oct 19, 2023
1 parent 3a09863 commit 22c79e2
Showing 1 changed file with 3 additions and 30 deletions.
33 changes: 3 additions & 30 deletions mal-impl/src/main/java/esa/mo/mal/impl/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import org.ccsds.moims.mo.mal.provider.MALInteractionHandler;
import org.ccsds.moims.mo.mal.structures.Blob;
import org.ccsds.moims.mo.mal.structures.URI;
import org.ccsds.moims.mo.mal.transport.MALEndpoint;

/**
Expand All @@ -34,10 +33,6 @@ public final class Address {
* The endpoint to use with this Address.
*/
private final MALEndpoint endpoint;
/**
* The URI that this Address represents.
*/
private final URI uri;
/**
* The authentication Id of this Address.
*/
Expand All @@ -51,51 +46,29 @@ public final class Address {
* Constructor.
*
* @param endpoint Endpoint.
* @param uri URI.
* @param authenticationId Authentication identifier.
* @param handler Interaction handler.
*/
public Address(final MALEndpoint endpoint,
final URI uri,
final Blob authenticationId,
final MALInteractionHandler handler) {
public Address(MALEndpoint endpoint, Blob authenticationId, MALInteractionHandler handler) {
this.endpoint = endpoint;
this.uri = uri;
this.authenticationId = authenticationId;
this.handler = handler;
}

/**
* Constructor.
*
* @param endpoint Endpoint.
* @param authenticationId Authentication identifier.
* @param handler Interaction handler.
*/
public Address(final MALEndpoint endpoint,
final Blob authenticationId,
final MALInteractionHandler handler) {
this(endpoint, endpoint.getURI(), authenticationId, handler);
}

public MALEndpoint getEndpoint() {
return endpoint;
}

public URI getURI() {
return uri;
}

public Blob getAuthenticationId() {
return authenticationId;
}

public MALInteractionHandler getHandler() {
return handler;
}

@Override
public String toString() {
return "Address(uri=" + uri + " - authenticationId=" + authenticationId + ")";
return "Address(uri=" + endpoint.getURI() + " - authenticationId=" + authenticationId + ")";
}
}

0 comments on commit 22c79e2

Please sign in to comment.