Skip to content

Commit 75453af

Browse files
committed
Rename headers
1 parent 6a4d593 commit 75453af

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ public final class ServiceMessage {
2020
* It is not supposed to be used by application directly and it is subject to changes in future
2121
* releases.
2222
*/
23-
public static final String HEADER_DATA_TYPE = "_type";
23+
public static final String HEADER_DATA_TYPE = "type";
2424

2525
/** Data format header. */
26-
public static final String HEADER_DATA_FORMAT = "_data_format";
26+
public static final String HEADER_DATA_FORMAT = "dataFormat";
2727

2828
/** Error type header. */
29-
public static final String ERROR_TYPE = "_error_type";
29+
public static final String HEADER_ERROR_TYPE = "errorType";
3030

3131
private Map<String, String> headers = new HashMap<>(1);
3232
private Object data;
@@ -63,7 +63,7 @@ public static ServiceMessage error(
6363
String qualifier, int errorType, int errorCode, String errorMessage) {
6464
return ServiceMessage.builder()
6565
.qualifier(qualifier)
66-
.header(ERROR_TYPE, String.valueOf(errorType))
66+
.header(HEADER_ERROR_TYPE, String.valueOf(errorType))
6767
.data(new ErrorData(errorCode, errorMessage))
6868
.build();
6969
}
@@ -162,7 +162,7 @@ public boolean hasData(Class<?> dataClass) {
162162
* @return <code>true</code> if error, otherwise <code>false</code>.
163163
*/
164164
public boolean isError() {
165-
return headers.containsKey(ERROR_TYPE);
165+
return headers.containsKey(HEADER_ERROR_TYPE);
166166
}
167167

168168
/**
@@ -171,7 +171,7 @@ public boolean isError() {
171171
* @return error type.
172172
*/
173173
public int errorType() {
174-
String errorType = headers.get(ERROR_TYPE);
174+
String errorType = headers.get(HEADER_ERROR_TYPE);
175175
if (errorType == null) {
176176
return -1;
177177
}

0 commit comments

Comments
 (0)