-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
170 additions
and
3 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
src/main/java/com/cdancy/bitbucket/rest/domain/branch/BranchModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* 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.cdancy.bitbucket.rest.domain.branch; | ||
|
||
import com.cdancy.bitbucket.rest.error.Error; | ||
import com.google.auto.value.AutoValue; | ||
import com.google.common.collect.ImmutableList; | ||
import org.jclouds.javax.annotation.Nullable; | ||
import org.jclouds.json.SerializedNames; | ||
|
||
import java.util.List; | ||
|
||
@AutoValue | ||
public abstract class BranchModel { | ||
|
||
@Nullable | ||
public abstract Branch development(); | ||
|
||
@Nullable | ||
public abstract Branch production(); | ||
|
||
@Nullable | ||
public abstract List<Type> types(); | ||
|
||
@Nullable | ||
public abstract List<Error> errors(); | ||
|
||
BranchModel() { | ||
} | ||
|
||
@SerializedNames({ "development", "production", "types", "errors" }) | ||
public static BranchModel create(Branch development, Branch production, List<Type> types, List<Error> errors) { | ||
return new AutoValue_BranchModel(development, production, | ||
types != null ? ImmutableList.copyOf(types) : ImmutableList.<Type> of(), | ||
errors != null ? ImmutableList.copyOf(errors) : ImmutableList.<Error> of()); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/cdancy/bitbucket/rest/domain/branch/Type.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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.cdancy.bitbucket.rest.domain.branch; | ||
|
||
import com.cdancy.bitbucket.rest.error.Error; | ||
import com.google.auto.value.AutoValue; | ||
import com.google.common.collect.ImmutableList; | ||
import org.jclouds.javax.annotation.Nullable; | ||
import org.jclouds.json.SerializedNames; | ||
|
||
import java.util.List; | ||
|
||
@AutoValue | ||
public abstract class Type { | ||
|
||
public abstract String id(); | ||
|
||
public abstract String displayName(); | ||
|
||
public abstract String prefix(); | ||
|
||
Type() { | ||
} | ||
|
||
@SerializedNames({ "id", "displayName", "prefix" }) | ||
public static Type create(String id, String displayName, String prefix) { | ||
return new AutoValue_Type(id, displayName, prefix); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"development":{ | ||
"id":"refs/heads/master", | ||
"displayId":"master", | ||
"type":"BRANCH", | ||
"latestCommit":"d90ca08fa076e2e4c076592fce3832aba80a494f", | ||
"latestChangeset":"d90ca08fa076e2e4c076592fce3832aba80a494f", | ||
"isDefault":true | ||
}, | ||
"types":[ | ||
{ | ||
"id":"BUGFIX", | ||
"displayName":"Bugfix", | ||
"prefix":"bugfix/" | ||
}, | ||
{ | ||
"id":"FEATURE", | ||
"displayName":"Feature", | ||
"prefix":"feature/" | ||
}, | ||
{ | ||
"id":"HOTFIX", | ||
"displayName":"Hotfix", | ||
"prefix":"hotfix/" | ||
}, | ||
{ | ||
"id":"RELEASE", | ||
"displayName":"Release", | ||
"prefix":"release/" | ||
} | ||
] | ||
} |