Package mops.persistence.file
Class FileInfo
- java.lang.Object
-
- mops.persistence.file.FileInfo
-
@AggregateRoot public class FileInfo extends java.lang.Object
Represents a file.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<FileInfo>
NAME_COMPARATOR
Name Comparator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileInfoBuilder
builder()
Gives you FileInfoBuilder.protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
java.time.Instant
getAvailableFrom()
Get the available from time.java.time.Instant
getAvailableTo()
Get the available to time.java.time.Instant
getCreationTime()
Get the creation time.long
getDirectoryId()
Id of the Directory this file resides in.java.lang.Long
getId()
Database Id.java.time.Instant
getLastModifiedTime()
Get the last modified time.@NonNull java.lang.String
getName()
File name.@NonNull java.lang.String
getOwner()
Username of the owner.long
getSize()
Size in bytes.java.lang.String
getSizeString()
Converts Byte to a String.@NonNull java.util.Set<mops.persistence.file.FileTag>
getTags()
File tags.@NonNull java.lang.String
getType()
File type.int
hashCode()
boolean
hasTag(java.lang.String otherTag)
Checks if the file is tagged with a specific tag.boolean
isAvailable(java.time.Instant time)
Tests whether this file is available at the given time.void
setDirectoryId(long directoryId)
Id of the Directory this file resides in.void
setName(@NonNull java.lang.String name)
File name.void
setOwner(@NonNull java.lang.String owner)
Username of the owner.void
setSize(long size)
Size in bytes.void
setTags(@NonNull java.util.Set<mops.persistence.file.FileTag> tags)
File tags.void
setType(@NonNull java.lang.String type)
File type.java.lang.String
toString()
-
-
-
Field Detail
-
NAME_COMPARATOR
public static final java.util.Comparator<FileInfo> NAME_COMPARATOR
Name Comparator.
-
-
Method Detail
-
builder
public static FileInfoBuilder builder()
Gives you FileInfoBuilder.- Returns:
- FileInfoBuilder
-
hasTag
public boolean hasTag(java.lang.String otherTag)
Checks if the file is tagged with a specific tag.- Parameters:
otherTag
- tag to check for- Returns:
- boolean
-
getAvailableFrom
public java.time.Instant getAvailableFrom()
Get the available from time.- Returns:
- available from time
-
getAvailableTo
public java.time.Instant getAvailableTo()
Get the available to time.- Returns:
- available to time
-
getCreationTime
public java.time.Instant getCreationTime()
Get the creation time.- Returns:
- creation time
-
getLastModifiedTime
public java.time.Instant getLastModifiedTime()
Get the last modified time.- Returns:
- last modified time
-
getSizeString
public java.lang.String getSizeString()
Converts Byte to a String.- Returns:
- Filesize with prefix.
-
isAvailable
public boolean isAvailable(java.time.Instant time)
Tests whether this file is available at the given time.- Parameters:
time
- current time- Returns:
- if this file is available
-
getId
public java.lang.Long getId()
Database Id.
-
getName
@NonNull public @NonNull java.lang.String getName()
File name.
-
getDirectoryId
public long getDirectoryId()
Id of the Directory this file resides in.
-
getType
@NonNull public @NonNull java.lang.String getType()
File type.
-
getSize
public long getSize()
Size in bytes.
-
getOwner
@NonNull public @NonNull java.lang.String getOwner()
Username of the owner.
-
getTags
@NonNull public @NonNull java.util.Set<mops.persistence.file.FileTag> getTags()
File tags.
-
setName
public void setName(@NonNull @NonNull java.lang.String name)
File name.
-
setDirectoryId
public void setDirectoryId(long directoryId)
Id of the Directory this file resides in.
-
setType
public void setType(@NonNull @NonNull java.lang.String type)
File type.
-
setSize
public void setSize(long size)
Size in bytes.
-
setOwner
public void setOwner(@NonNull @NonNull java.lang.String owner)
Username of the owner.
-
setTags
public void setTags(@NonNull @NonNull java.util.Set<mops.persistence.file.FileTag> tags)
File tags.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-