This is the codeAbility Sharing Platform! Learn more about the
codeAbility Sharing Platform
.
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
codeAbility Sharing Platform
Manage
Activity
Members
Labels
Plan
Issues
43
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
development
sharing
codeAbility Sharing Platform
Commits
68c39617
Commit
68c39617
authored
4 years ago
by
Daniel Rainer
Browse files
Options
Downloads
Patches
Plain Diff
Add "file" metadata
parent
0ddbd63c
2 merge requests
!17
Initial Merge to Prepare Release 1.0.0
,
!2
Add gitlab metadata
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/at/ac/uibk/gitsearch/service/dto/SearchResultDTO.java
+82
-0
82 additions, 0 deletions
...ava/at/ac/uibk/gitsearch/service/dto/SearchResultDTO.java
with
82 additions
and
0 deletions
src/main/java/at/ac/uibk/gitsearch/service/dto/SearchResultDTO.java
+
82
−
0
View file @
68c39617
...
...
@@ -5,6 +5,7 @@ import java.util.Objects;
public
class
SearchResultDTO
{
private
GitProject
project
;
private
MetadataFile
file
;
private
UserProvidedMetadataDTO
metadata
;
public
SearchResultDTO
()
{
...
...
@@ -19,6 +20,7 @@ public class SearchResultDTO {
public
SearchResultDTO
(
SearchResultDTO
toClone
)
{
super
();
this
.
project
=
toClone
.
project
;
this
.
file
=
toClone
.
file
;
this
.
metadata
=
toClone
.
metadata
;
}
...
...
@@ -30,6 +32,14 @@ public class SearchResultDTO {
this
.
project
=
project
;
}
public
MetadataFile
getFile
()
{
return
file
;
}
public
void
setFile
(
MetadataFile
file
)
{
this
.
file
=
file
;
}
public
UserProvidedMetadataDTO
getMetadata
()
{
return
metadata
;
}
...
...
@@ -41,6 +51,7 @@ public class SearchResultDTO {
@Override
public
String
toString
()
{
return
"SearchResultDTO : { project: "
+
this
.
project
+
", file: "
+
this
.
file
+
", metadata: "
+
this
.
metadata
+
" }"
;
}
...
...
@@ -49,6 +60,7 @@ public class SearchResultDTO {
public
int
hashCode
()
{
int
prime
=
31
;
int
result
=
this
.
project
.
hashCode
();
result
=
prime
*
result
+
this
.
file
.
hashCode
();
result
=
prime
*
result
+
this
.
metadata
.
hashCode
();
return
result
;
}
...
...
@@ -63,6 +75,7 @@ public class SearchResultDTO {
}
SearchResultDTO
other
=
(
SearchResultDTO
)
obj
;
return
Objects
.
equals
(
this
.
project
,
other
.
project
)
&&
Objects
.
equals
(
this
.
file
,
other
.
file
)
&&
Objects
.
equals
(
this
.
metadata
,
other
.
metadata
);
}
...
...
@@ -158,4 +171,73 @@ public class SearchResultDTO {
+
" }"
;
}
}
public
static
class
MetadataFile
{
private
String
filename
;
private
String
path
;
private
String
commit_id
;
private
String
indexing_date
;
public
String
getFilename
()
{
return
filename
;
}
public
void
setFilename
(
String
filename
)
{
this
.
filename
=
filename
;
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
public
String
getCommit_id
()
{
return
commit_id
;
}
public
void
setCommit_id
(
String
commit_id
)
{
this
.
commit_id
=
commit_id
;
}
public
String
getIndexing_date
()
{
return
indexing_date
;
}
public
void
setIndexing_date
(
String
indexing_date
)
{
this
.
indexing_date
=
indexing_date
;
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
this
.
path
.
hashCode
();
result
=
prime
*
result
+
this
.
commit_id
.
hashCode
();
return
result
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
{
return
true
;
}
if
(!(
obj
instanceof
MetadataFile
))
{
return
false
;
}
MetadataFile
other
=
(
MetadataFile
)
obj
;
return
Objects
.
equals
(
this
.
path
,
other
.
path
)
&&
Objects
.
equals
(
this
.
commit_id
,
other
.
commit_id
);
}
@Override
public
String
toString
()
{
return
"MetadataFile: { filename: "
+
this
.
filename
+
", path: "
+
this
.
path
+
", commit_id: "
+
this
.
commit_id
+
", indexing_date: "
+
this
.
indexing_date
+
" }"
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment