Class ProtobufCompatibilityCheckerLibrary


  • public class ProtobufCompatibilityCheckerLibrary
    extends Object
    Provides compatibility validation functions for changes between two versions of a Protobuf schema document.
    Author:
    Jonathan Halliday, Ales Justin
    See Also:
    Protolock
    • Constructor Detail

      • ProtobufCompatibilityCheckerLibrary

        public ProtobufCompatibilityCheckerLibrary​(ProtobufFile fileBefore,
                                                   ProtobufFile fileAfter)
    • Method Detail

      • validate

        public boolean validate()
      • checkNoUsingReservedFields

        public List<ProtobufDifference> checkNoUsingReservedFields()
        Determine if any message's previously reserved fields or IDs are now being used as part of the same message.

        Note: TODO can't currently validate enum reserved fields, as the parser doesn't capture those.

        Returns:
        differences list
      • checkNoRemovingReservedFields

        public List<ProtobufDifference> checkNoRemovingReservedFields()
        Determine if any reserved field has been removed.

        Note: TODO can't currently validate enum reserved fields, as the parser doesn't capture those.

        Returns:
        differences list
      • checkNoRemovingFieldsWithoutReserve

        public List<ProtobufDifference> checkNoRemovingFieldsWithoutReserve()
        Determine if any field has been removed without a corresponding reservation of that field name or ID.

        Note: TODO can't currently validate enum reserved fields, as the parser doesn't capture those.

        Returns:
        differences list
      • checkNoChangingFieldIDs

        public List<ProtobufDifference> checkNoChangingFieldIDs()
        Determine if any field ID number has been changed.
        Returns:
        differences list
      • checkNoChangingFieldTypes

        public List<ProtobufDifference> checkNoChangingFieldTypes()
        Determine if any field type has been changed.
        Returns:
        differences list
      • checkNoChangingFieldNames

        public List<ProtobufDifference> checkNoChangingFieldNames()
        Determine if any message's previous fields have been renamed.
        Returns:
        differences list
      • checkNoRemovingServiceRPCs

        public List<ProtobufDifference> checkNoRemovingServiceRPCs()
        Determine if any RPCs provided by a Service have been removed.
        Returns:
        differences list
      • checkNoChangingRPCSignature

        public List<ProtobufDifference> checkNoChangingRPCSignature()
        Determine if any RPC signature has been changed while using the same name.
        Returns:
        differences list