-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new method for random objects creation
- Loading branch information
Showing
4 changed files
with
212 additions
and
13 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
69 changes: 69 additions & 0 deletions
69
src/test/java/de/alpharogroup/evaluate/object/verifier/ManifestVersion.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,69 @@ | ||
package de.alpharogroup.evaluate.object.verifier; | ||
|
||
import java.io.Serializable; | ||
import java.time.LocalDateTime; | ||
import java.util.jar.Attributes; | ||
import java.util.jar.Manifest; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import lombok.experimental.FieldDefaults; | ||
|
||
/** | ||
* Simple bean to hold information about the version of a Manifest. Can be used for JAR, EAR and WAR | ||
* manifest files. | ||
*/ | ||
@Getter | ||
@Setter | ||
@EqualsAndHashCode | ||
@ToString | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder(toBuilder = true) | ||
@FieldDefaults(level = AccessLevel.PRIVATE) | ||
public class ManifestVersion implements Serializable | ||
{ | ||
|
||
/** The serialVersionUID. */ | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** The last modified holds the {@code LocalDateTime} when the last build was. */ | ||
LocalDateTime lastModified; | ||
|
||
/** The manifest. */ | ||
Manifest manifest; | ||
|
||
/** The title. */ | ||
String title; | ||
|
||
/** The version number. */ | ||
String version; | ||
|
||
/** | ||
* Gets the manifest attribute value from the given {@code Attributes.Name} object. | ||
* | ||
* @param name | ||
* the name | ||
* @return the manifest attribute or an empty String if the manifest attribute value is null | ||
*/ | ||
public String getManifestAttribute(final Attributes.Name name) | ||
{ | ||
if (getManifest() != null) | ||
{ | ||
final Attributes attributes = getManifest().getMainAttributes(); | ||
final Object value = attributes.get(name); | ||
if (value != null) | ||
{ | ||
return value.toString().trim(); | ||
} | ||
} | ||
return ""; | ||
} | ||
|
||
} |