GithubHelp home page GithubHelp logo

opportunitylivetv / swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebookarchive/swift

1.0 3.0 1.0 5.67 MB

An annotation-based Java library for creating Thrift serializable types and services.

License: Apache License 2.0

Java 85.12% HTML 1.18% Thrift 12.81% GAP 0.89%

swift's Introduction

Swift

Swift is an easy-to-use, annotation-based Java library for creating Thrift serializable types and services.

Swift Codec

Swift Codec is a simple library specifying how Java objects are converted to and from Thrift. This library is similar to JaxB (XML) and Jackson (JSON), but for Thrift. Swift codec supports field, method, constructor, and builder injection. For example:

@ThriftStruct
public class LogEntry
{
    private final String category;
    private final String message;

    @ThriftConstructor
    public LogEntry(String category, String message)
    {
        this.category = category;
        this.message = message;
    }

    @ThriftField(1)
    public String getCategory()
    {
        return category;
    }

    @ThriftField(2)
    public String getMessage()
    {
        return message;
    }
}

Swift Service

Swift Service is a simple library annotating services to be exported with Thrift. For example:

@ThriftService("scribe")
public class InMemoryScribe
{
    private final List<LogEntry> messages = new ArrayList<>();

    public List<LogEntry> getMessages()
    {
        return messages;
    }

    @ThriftMethod("Log")
    public ResultCode log(List<LogEntry> messages)
    {
        this.messages.addAll(messages);
        return ResultCode.OK;
    }
}

Swift Generator

Swift Generator is a library that creates Java code usable with the Swift codec from Thrift IDL files and vice versa.

Swift Generator CLI and Swift2Thrift Generator CLI are command-line front-ends to this generator.

Swift Maven plugin

Swift Maven plugin allows using the code generator from a maven build and generate source code on the fly.

swift's People

Contributors

andrewcox avatar dain avatar hgschmie avatar alandau avatar electrum avatar skreyen avatar l3fang avatar martint avatar jesboat avatar tomdz avatar shootingsyh avatar tageorgiou avatar mdzhou avatar erichwang avatar alex-sherwin avatar bgould avatar cberner avatar groys avatar ronnienigash avatar scottgoldwater avatar phonyphonecall avatar siyengar avatar twilliamson avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

martina6hall

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.