Skip to content

Commit

Permalink
- Changed license from GNU GPL to MIT
Browse files Browse the repository at this point in the history
- Updated dependencies
- Added author
  • Loading branch information
rgushel committed May 14, 2018
1 parent cdd4c25 commit b7b3e65
Show file tree
Hide file tree
Showing 72 changed files with 2,044 additions and 1,553 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2014-2018 BAData LLC, https://badata.net

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![Build Status](https://api.travis-ci.org/BAData/protobuf-converter.svg)](https://travis-ci.org/BAData/protobuf-converter)
[![GitHub release](https://img.shields.io/github/release/BAData/protobuf-converter.svg)](https://github.com/BAData/protobuf-converter/releases)
[![Slack Status](http://badata-support.herokuapp.com/badge.svg)](https://badata-support.herokuapp.com)
[![JitPack repository](https://jitpack.io/v/BAData/protobuf-converter.svg)](https://jitpack.io/#BAData/protobuf-converter)
# Protobuf converter
**protobuf-converter** is library for transforming your Domain Model Objects into Google Protobuf Messages and vice versa.
Expand Down Expand Up @@ -137,4 +136,4 @@ java -jar example.jar

# License

GNU General Public License v3.0
MIT License
21 changes: 3 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}
}
dependencies {
classpath "gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.7.6"
classpath "gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.5"
}
}

Expand All @@ -27,13 +27,13 @@ targetCompatibility='1.7'

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0-beta-1'
artifact = 'com.google.protobuf:protoc:3.5.1'
}
generatedFilesBaseDir = "$projectDir/src"
}

dependencies {
compile 'com.google.protobuf:protobuf-java:3.0.0-beta-1'
compile 'com.google.protobuf:protobuf-java:3.5.1'
testCompile 'junit:junit:4.12'
}

Expand All @@ -50,19 +50,4 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
artifacts {
archives sourcesJar
archives javadocJar
}

// To specify a license in the pom:
install {
repositories.mavenInstaller {
pom.project {
licenses {
license {
name 'GNU General Public License v3.0'
url 'http://www.gnu.org/licenses/gpl-3.0.txt'
distribution 'repo'
}
}
}
}
}
10 changes: 5 additions & 5 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}
}
dependencies {
classpath "gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.7.6"
classpath "gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.5"
}
}

Expand Down Expand Up @@ -40,11 +40,11 @@ jar {

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0-beta-1'
artifact = 'com.google.protobuf:protoc:3.5.1'
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:0.9.0'
artifact = 'io.grpc:protoc-gen-grpc-java:1.12.0'
}
}
generateProtoTasks {
Expand All @@ -58,6 +58,6 @@ protobuf {

dependencies {
compile files("libs/protobuf-converter.jar")
compile 'com.google.protobuf:protobuf-java:3.0.0-beta-1'
compile 'io.grpc:grpc-all:0.9.0'
compile 'com.google.protobuf:protobuf-java:3.5.1'
compile 'io.grpc:grpc-all:1.12.0'
}
Binary file modified example/libs/protobuf-converter.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions example/src/main/java/net/badata/protobuf/example/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import net.badata.protobuf.example.server.ProtobufServer;

/**
* Created by jsjem on 04.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class Main {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package net.badata.protobuf.example.client;

/**
* Created by jsjem on 05.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class ClientException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
import java.util.concurrent.TimeUnit;

/**
* Created by jsjem on 04.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class ProtobufClient {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import net.badata.protobuf.example.proto.Book;

/**
* Created by jsjem on 05.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class BookMapper extends DefaultMapperImpl {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import net.badata.protobuf.example.proto.BookState;

/**
* Created by jsjem on 05.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class BooleanEnumConverter implements TypeConverter<Boolean, BookState> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import net.badata.protobuf.example.proto.User;

/**
* Created by jsjem on 04.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
@ProtoClass(User.class)
public class Reader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import net.badata.protobuf.example.proto.Book;

/**
* Created by jsjem on 04.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
@ProtoClass(value = Book.class, mapper = BookMapper.class)
public class ReadingBook {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
import java.text.NumberFormat;

/**
* Created by jsjem on 06.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class AddBookView implements ActionListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
import java.util.List;

/**
* Created by jsjem on 05.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class ClientWindow implements LoginView.OnLoginActionListener, AddBookView.OnAddBookActionListener,
LibraryView.OnLibraryActionListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
import java.util.List;

/**
* Created by jsjem on 06.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class LibraryView implements ActionListener, ListSelectionListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import java.awt.event.ActionListener;

/**
* Created by jsjem on 06.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class LoginView implements ActionListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
import java.util.List;

/**
* Created by jsjem on 04.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class LibraryService implements LibraryServiceGrpc.LibraryService {
public class LibraryService extends LibraryServiceGrpc.LibraryServiceImplBase {

private final MemoryDatabase database;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
import java.util.Set;

/**
* Created by jsjem on 05.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class MemoryDatabase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
import java.io.IOException;

/**
* Created by jsjem on 04.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
public class ProtobufServer {

Expand All @@ -20,7 +19,7 @@ public class ProtobufServer {

public void start() throws IOException, InterruptedException {
server = ServerBuilder.forPort(PORT)
.addService(LibraryServiceGrpc.bindService(new LibraryService(database)))
.addService(new LibraryService(database))
.build()
.start();
Runtime.getRuntime().addShutdownHook(new Thread() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import java.util.Objects;

/**
* Created by jsjem on 04.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
@ProtoClass(Book.class)
public class LibraryBook {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import net.badata.protobuf.example.proto.User;

/**
* Created by jsjem on 04.05.2016.
*
* @author jsjem
* @author Roman Gushel
*/
@ProtoClass(value = User.class)
public class Reader {
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri May 06 16:25:28 EEST 2016
#Mon May 14 12:06:50 EEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
18 changes: 1 addition & 17 deletions src/main/java/net/badata/protobuf/converter/Configuration.java
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
/*
* Copyright (C) 2016 BAData Creative Studio
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/

package net.badata.protobuf.converter;

/**
* Contains configuration parameters that will be used by {@link net.badata.protobuf.converter.Converter
* Converter} during performing of object conversion.
*
* @author jsjem
* @author Roman Gushel
*/
public final class Configuration {

Expand Down
20 changes: 3 additions & 17 deletions src/main/java/net/badata/protobuf/converter/Converter.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
* Copyright (C) 2016 BAData Creative Studio
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/

package net.badata.protobuf.converter;

import com.google.protobuf.Message;
Expand All @@ -41,6 +24,7 @@
* Converts data from Protobuf messages to domain model objects and vice versa.
*
* @author jsjem
* @author Roman Gushel
*/
public final class Converter {

Expand Down Expand Up @@ -73,6 +57,7 @@ public static Converter create(final FieldsIgnore fieldsIgnore) {
* Create configured converter.
*
* @param configuration Parameters for conversion.
* @return Converter instance.
*/
public static Converter create(final Configuration configuration) {
return new Converter(configuration);
Expand Down Expand Up @@ -321,6 +306,7 @@ private void fillProtobufField(final FieldResolver fieldResolver, final MappingR
}
}

@SuppressWarnings("unchecked")
private <E extends Message> Collection<?> createProtobufValueList(final Class<E> type, final Class<?>
domainCollectionClass, final Collection<?> domainCollection) {
return createNestedConverter()
Expand Down
Loading

0 comments on commit b7b3e65

Please sign in to comment.