-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[672] Add support for a ViewDeletionRequest
Bug: #672 Signed-off-by: Hugo Marchadour <[email protected]>
- Loading branch information
1 parent
62f1b19
commit 53c32ad
Showing
13 changed files
with
304 additions
and
69 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
...irius-web-diagrams/src/main/java/org/eclipse/sirius/web/diagrams/ViewDeletionRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sirius.web.diagrams; | ||
|
||
import java.text.MessageFormat; | ||
import java.util.Objects; | ||
import java.util.UUID; | ||
|
||
import org.eclipse.sirius.web.annotations.Immutable; | ||
|
||
/** | ||
* A view deletion request. | ||
* | ||
* @author hmarchadour | ||
*/ | ||
@Immutable | ||
public final class ViewDeletionRequest { | ||
|
||
private UUID elementId; | ||
|
||
private ViewDeletionRequest() { | ||
// Prevent instantiation | ||
} | ||
|
||
public UUID getElementId() { | ||
return this.elementId; | ||
} | ||
|
||
public static Builder newViewDeletionRequest() { | ||
return new Builder(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
String pattern = "{0} '{'elementId: {1}'}'"; //$NON-NLS-1$ | ||
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.elementId); | ||
} | ||
|
||
/** | ||
* The builder used to create a new {@link ViewDeletionRequest}. | ||
* | ||
* @author hmarchadour | ||
*/ | ||
@SuppressWarnings("checkstyle:HiddenField") | ||
public static final class Builder { | ||
|
||
private UUID elementId; | ||
|
||
private Builder() { | ||
// Prevent instantiation | ||
} | ||
|
||
public Builder elementId(UUID elementId) { | ||
this.elementId = Objects.requireNonNull(elementId); | ||
return this; | ||
} | ||
|
||
public ViewDeletionRequest build() { | ||
ViewDeletionRequest viewDeletionRequest = new ViewDeletionRequest(); | ||
viewDeletionRequest.elementId = Objects.requireNonNull(this.elementId); | ||
return viewDeletionRequest; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.