Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
28969573
Commit
28969573
authored
Dec 28, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added method to get interface instance with default values
parent
adf701b9
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
357 additions
and
40 deletions
+357
-40
ApiCallback.java
...n/java/nl/uva/sne/drip/sure/tosca/client/ApiCallback.java
+5
-4
ApiException.java
.../java/nl/uva/sne/drip/sure/tosca/client/ApiException.java
+4
-4
ApiResponse.java
...n/java/nl/uva/sne/drip/sure/tosca/client/ApiResponse.java
+1
-2
Configuration.java
...java/nl/uva/sne/drip/sure/tosca/client/Configuration.java
+2
-3
DefaultApi.java
...in/java/nl/uva/sne/drip/sure/tosca/client/DefaultApi.java
+320
-0
JSON.java
...src/main/java/nl/uva/sne/drip/sure/tosca/client/JSON.java
+23
-25
Pair.java
...src/main/java/nl/uva/sne/drip/sure/tosca/client/Pair.java
+1
-1
StringUtil.java
...in/java/nl/uva/sne/drip/sure/tosca/client/StringUtil.java
+1
-1
No files found.
drip-commons/src/main/java/nl/uva/sne/drip/sure/tosca/client/ApiCallback.java
View file @
28969573
...
...
@@ -9,8 +9,6 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package
nl
.
uva
.
sne
.
drip
.
sure
.
tosca
.
client
;
...
...
@@ -23,12 +21,15 @@ import java.util.List;
* @param <T> The return type
*/
public
interface
ApiCallback
<
T
>
{
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
* @param statusCode Status code of the response if available, otherwise it
* would be 0
* @param responseHeaders Headers of the response if available, otherwise it
* would be null
*/
void
onFailure
(
ApiException
e
,
int
statusCode
,
Map
<
String
,
List
<
String
>>
responseHeaders
);
...
...
drip-commons/src/main/java/nl/uva/sne/drip/sure/tosca/client/ApiException.java
View file @
28969573
...
...
@@ -9,20 +9,20 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package
nl
.
uva
.
sne
.
drip
.
sure
.
tosca
.
client
;
import
java.util.Map
;
import
java.util.List
;
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-2
5T13:58:54.535
Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-2
8T19:11:27.492
Z"
)
public
class
ApiException
extends
Exception
{
private
int
code
=
0
;
private
Map
<
String
,
List
<
String
>>
responseHeaders
=
null
;
private
String
responseBody
=
null
;
public
ApiException
()
{}
public
ApiException
()
{
}
public
ApiException
(
Throwable
throwable
)
{
super
(
throwable
);
...
...
drip-commons/src/main/java/nl/uva/sne/drip/sure/tosca/client/ApiResponse.java
View file @
28969573
...
...
@@ -9,8 +9,6 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package
nl
.
uva
.
sne
.
drip
.
sure
.
tosca
.
client
;
import
java.util.List
;
...
...
@@ -22,6 +20,7 @@ import java.util.Map;
* @param <T> The type of data that is deserialized from response body
*/
public
class
ApiResponse
<
T
>
{
final
private
int
statusCode
;
final
private
Map
<
String
,
List
<
String
>>
headers
;
final
private
T
data
;
...
...
drip-commons/src/main/java/nl/uva/sne/drip/sure/tosca/client/Configuration.java
View file @
28969573
...
...
@@ -9,12 +9,11 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package
nl
.
uva
.
sne
.
drip
.
sure
.
tosca
.
client
;
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-2
5T13:58:54.535
Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-2
8T19:11:27.492
Z"
)
public
class
Configuration
{
private
static
ApiClient
defaultApiClient
=
new
ApiClient
();
/**
...
...
drip-commons/src/main/java/nl/uva/sne/drip/sure/tosca/client/DefaultApi.java
View file @
28969573
This diff is collapsed.
Click to expand it.
drip-commons/src/main/java/nl/uva/sne/drip/sure/tosca/client/JSON.java
View file @
28969573
...
...
@@ -9,6 +9,8 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package
nl
.
uva
.
sne
.
drip
.
sure
.
tosca
.
client
;
import
com.google.gson.Gson
;
...
...
@@ -23,7 +25,7 @@ import io.gsonfire.GsonFireBuilder;
import
org.threeten.bp.LocalDate
;
import
org.threeten.bp.OffsetDateTime
;
import
org.threeten.bp.format.DateTimeFormatter
;
;
import
okio.ByteString
;
import
java.io.IOException
;
...
...
@@ -35,10 +37,7 @@ import java.text.ParsePosition;
import
java.util.Date
;
import
java.util.Map
;
public
class
JSON
{
private
Gson
gson
;
private
boolean
isLenientOnJson
=
false
;
private
DateTypeAdapter
dateTypeAdapter
=
new
DateTypeAdapter
();
...
...
@@ -48,14 +47,15 @@ public class JSON {
private
ByteArrayAdapter
byteArrayAdapter
=
new
ByteArrayAdapter
();
public
static
GsonBuilder
createGson
()
{
GsonFireBuilder
fireBuilder
=
new
GsonFireBuilder
();
GsonFireBuilder
fireBuilder
=
new
GsonFireBuilder
()
;
GsonBuilder
builder
=
fireBuilder
.
createGsonBuilder
();
return
builder
;
}
private
static
String
getDiscriminatorValue
(
JsonElement
readElement
,
String
discriminatorField
)
{
JsonElement
element
=
readElement
.
getAsJsonObject
().
get
(
discriminatorField
);
if
(
null
==
element
)
{
if
(
null
==
element
)
{
throw
new
IllegalArgumentException
(
"missing discriminator field: <"
+
discriminatorField
+
">"
);
}
return
element
.
getAsString
();
...
...
@@ -63,7 +63,7 @@ public class JSON {
private
static
Class
getClassByDiscriminator
(
Map
classByDiscriminatorValue
,
String
discriminatorValue
)
{
Class
clazz
=
(
Class
)
classByDiscriminatorValue
.
get
(
discriminatorValue
.
toUpperCase
());
if
(
null
==
clazz
)
{
if
(
null
==
clazz
)
{
throw
new
IllegalArgumentException
(
"cannot determine model class of name: <"
+
discriminatorValue
+
">"
);
}
return
clazz
;
...
...
@@ -71,12 +71,12 @@ public class JSON {
public
JSON
()
{
gson
=
createGson
()
.
registerTypeAdapter
(
Date
.
class
,
dateTypeAdapter
)
.
registerTypeAdapter
(
java
.
sql
.
Date
.
class
,
sqlDateTypeAdapter
)
.
registerTypeAdapter
(
OffsetDateTime
.
class
,
offsetDateTimeTypeAdapter
)
.
registerTypeAdapter
(
LocalDate
.
class
,
localDateTypeAdapter
)
.
registerTypeAdapter
(
byte
[].
class
,
byteArrayAdapter
)
.
create
();
.
registerTypeAdapter
(
Date
.
class
,
dateTypeAdapter
)
.
registerTypeAdapter
(
java
.
sql
.
Date
.
class
,
sqlDateTypeAdapter
)
.
registerTypeAdapter
(
OffsetDateTime
.
class
,
offsetDateTimeTypeAdapter
)
.
registerTypeAdapter
(
LocalDate
.
class
,
localDateTypeAdapter
)
.
registerTypeAdapter
(
byte
[].
class
,
byteArrayAdapter
)
.
create
();
}
/**
...
...
@@ -117,8 +117,8 @@ public class JSON {
/**
* Deserialize the given JSON string to Java object.
*
* @param <T> Type
* @param body The JSON string
* @param <T>
Type
* @param body
The JSON string
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
...
...
@@ -136,11 +136,9 @@ public class JSON {
}
catch
(
JsonParseException
e
)
{
// Fallback processing when failed to parse JSON form response body:
// return the response body string directly for the String return type;
if
(
returnType
.
equals
(
String
.
class
))
{
if
(
returnType
.
equals
(
String
.
class
))
return
(
T
)
body
;
}
else
{
throw
(
e
);
}
else
throw
(
e
);
}
}
...
...
@@ -209,7 +207,7 @@ public class JSON {
default
:
String
date
=
in
.
nextString
();
if
(
date
.
endsWith
(
"+0000"
))
{
date
=
date
.
substring
(
0
,
date
.
length
()
-
5
)
+
"Z"
;
date
=
date
.
substring
(
0
,
date
.
length
()
-
5
)
+
"Z"
;
}
return
OffsetDateTime
.
parse
(
date
,
formatter
);
}
...
...
@@ -268,9 +266,9 @@ public class JSON {
}
/**
* Gson TypeAdapter for java.sql.Date type
If the dateFormat is null, a
*
simple "yyyy-MM-dd" format will be used (more efficient than
* SimpleDateFormat).
* Gson TypeAdapter for java.sql.Date type
*
If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
*
(more efficient than
SimpleDateFormat).
*/
public
static
class
SqlDateTypeAdapter
extends
TypeAdapter
<
java
.
sql
.
Date
>
{
...
...
@@ -323,8 +321,8 @@ public class JSON {
}
/**
* Gson TypeAdapter for java.util.Date type
If the dateFormat is null,
* ISO8601Utils will be used.
* Gson TypeAdapter for java.util.Date type
* I
f the dateFormat is null, I
SO8601Utils will be used.
*/
public
static
class
DateTypeAdapter
extends
TypeAdapter
<
Date
>
{
...
...
drip-commons/src/main/java/nl/uva/sne/drip/sure/tosca/client/Pair.java
View file @
28969573
...
...
@@ -13,7 +13,7 @@
package
nl
.
uva
.
sne
.
drip
.
sure
.
tosca
.
client
;
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-2
5T13:58:54.535
Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-2
8T19:11:27.492
Z"
)
public
class
Pair
{
private
String
name
=
""
;
private
String
value
=
""
;
...
...
drip-commons/src/main/java/nl/uva/sne/drip/sure/tosca/client/StringUtil.java
View file @
28969573
...
...
@@ -13,7 +13,7 @@
package
nl
.
uva
.
sne
.
drip
.
sure
.
tosca
.
client
;
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-2
5T13:58:54.535
Z"
)
@javax
.
annotation
.
Generated
(
value
=
"io.swagger.codegen.languages.JavaClientCodegen"
,
date
=
"2019-12-2
8T19:11:27.492
Z"
)
public
class
StringUtil
{
/**
* Check if the given array contains the given value (with case-insensitive comparison).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment