Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

Commit

Permalink
fixing some enum names and adding response base classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Kerwin committed Mar 3, 2017
1 parent 2445575 commit 4edde7f
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 5 deletions.
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>

<artifactId>hub-common-response</artifactId>
<version>0.0.3-SNAPSHOT</version>
<version>0.0.3</version>

<name>Hub Common Response</name>
<description>A library for describing Black Duck Hub requests and responses.</description>
Expand All @@ -21,4 +21,12 @@
<developerConnection>scm:git:git@github.com:blackducksoftware/hub-common-response.git</developerConnection>
<url>https://www.github.com/blackducksoftware/hub-common-response</url>
</scm>

<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Hub Common Response
*
* Copyright (C) 2017 Black Duck Software, Inc.
* http://www.blackducksoftware.com/
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.blackducksoftware.integration.hub.model.response;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.RecursiveToStringStyle;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

/**
* All Hub API Responses should be marshalled in to instances of this class.
*/
public class HubResponse {
public String json;

@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}

@Override
public boolean equals(final Object obj) {
return EqualsBuilder.reflectionEquals(this, obj);
}

@Override
public String toString() {
return ReflectionToStringBuilder.toString(this, RecursiveToStringStyle.JSON_STYLE);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
package com.blackducksoftware.integration.hub.model.type;

public enum ReportReportFormatEnum {
public enum ReportFormatEnum {
CSV,
JSON,
TEXT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
package com.blackducksoftware.integration.hub.model.type;

public enum RiskCountCountEnum {
public enum RiskCountEnum {
UNKNOWN,
OK,
LOW,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
package com.blackducksoftware.integration.hub.model.type;

public enum VersionBomLicenseLicenseEnum {
public enum VersionBomLicenseEnum {
CONJUNCTIVE,
DISJUNCTIVE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
package com.blackducksoftware.integration.hub.model.type;

public enum VulnerabilityWithRemediationRemediationStatusEnum {
public enum VulnerabilityWithRemediationStatusEnum {
DUPLICATE,
IGNORED,
MITIGATED,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Hub Common Response
*
* Copyright (C) 2017 Black Duck Software, Inc.
* http://www.blackducksoftware.com/
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.blackducksoftware.integration.hub.model.view;

import com.blackducksoftware.integration.hub.model.response.HubResponse;

/**
* A marker class used when a HubResponse has the '_meta' property which, for now, must be determined manually by
* actually performing requests against Hub endpoints.
*/
public class HubView extends HubResponse {

}

0 comments on commit 4edde7f

Please sign in to comment.