Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
169 additions
and
46 deletions.
There are no files selected for viewing
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
54 changes: 54 additions & 0 deletions
54
de.metas.business/src/main/java/de/metas/order/compensationGroup/GroupTemplateId.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,54 @@ | ||
package de.metas.order.compensationGroup; | ||
|
||
import org.adempiere.util.Check; | ||
|
||
import lombok.Value; | ||
|
||
/* | ||
* #%L | ||
* de.metas.business | ||
* %% | ||
* Copyright (C) 2018 metas GmbH | ||
* %% | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation, either version 2 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/gpl-2.0.html>. | ||
* #L% | ||
*/ | ||
|
||
@Value | ||
public class GroupTemplateId | ||
{ | ||
int repoId; | ||
|
||
public static GroupTemplateId ofRepoId(final int repoId) | ||
{ | ||
return new GroupTemplateId(repoId); | ||
} | ||
|
||
public static GroupTemplateId ofRepoIdOrNull(final int repoId) | ||
{ | ||
return repoId > 0 ? new GroupTemplateId(repoId) : null; | ||
} | ||
|
||
public static int toRepoId(final GroupTemplateId groupTemplateId) | ||
{ | ||
return groupTemplateId != null ? groupTemplateId.getRepoId() : -1; | ||
} | ||
|
||
private GroupTemplateId(final int repoId) | ||
{ | ||
this.repoId = Check.assumeGreaterThanZero(repoId, "repoId"); | ||
} | ||
|
||
} |
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
53 changes: 53 additions & 0 deletions
53
de.metas.business/src/main/java/de/metas/order/compensationGroup/GroupTemplateLineId.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,53 @@ | ||
package de.metas.order.compensationGroup; | ||
|
||
import org.adempiere.util.Check; | ||
|
||
import lombok.Value; | ||
|
||
/* | ||
* #%L | ||
* de.metas.business | ||
* %% | ||
* Copyright (C) 2018 metas GmbH | ||
* %% | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation, either version 2 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/gpl-2.0.html>. | ||
* #L% | ||
*/ | ||
|
||
@Value | ||
public class GroupTemplateLineId | ||
{ | ||
int repoId; | ||
|
||
public static GroupTemplateLineId ofRepoId(final int repoId) | ||
{ | ||
return new GroupTemplateLineId(repoId); | ||
} | ||
|
||
public static GroupTemplateLineId ofRepoIdOrNull(final int repoId) | ||
{ | ||
return repoId > 0 ? ofRepoId(repoId) : null; | ||
} | ||
|
||
public static int toRepoId(final GroupTemplateLineId groupSchemaLineId) | ||
{ | ||
return groupSchemaLineId != null ? groupSchemaLineId.getRepoId() : -1; | ||
} | ||
|
||
private GroupTemplateLineId(final int repoId) | ||
{ | ||
this.repoId = Check.assumeGreaterThanZero(repoId, "repoId"); | ||
} | ||
} |
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.