CN115061664A - Object conversion method and device, electronic equipment and storage medium - Google Patents

Object conversion method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115061664A
CN115061664A CN202210790689.7A CN202210790689A CN115061664A CN 115061664 A CN115061664 A CN 115061664A CN 202210790689 A CN202210790689 A CN 202210790689A CN 115061664 A CN115061664 A CN 115061664A
Authority
CN
China
Prior art keywords
converted
type
conversion
type object
target type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210790689.7A
Other languages
Chinese (zh)
Inventor
熊必可
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202210790689.7A priority Critical patent/CN115061664A/en
Publication of CN115061664A publication Critical patent/CN115061664A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an object conversion method, an object conversion device, electronic equipment and a storage medium. The method comprises the following steps: acquiring an object to be converted; converting the object to be converted based on a static conversion rule to obtain a target type object, and assigning the attribute value of the object to be converted to the target type object; wherein the static conversion rule realizes object conversion through a reflection mechanism. According to the technical scheme, the conversion of various object types is realized through a reflection mechanism.

Description

Object conversion method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of object processing technologies, and in particular, to an object transformation method and apparatus, an electronic device, and a storage medium.
Background
In software architecture design, a layered architecture is the most widely applied architecture model. In a software system adopting a layered architecture, object conversion between different layers is a very frequent operation in the software development process.
For a software system adopting JAVA language, under a Springmvc framework, data transmission of different types of objects exists between different levels.
In the process of implementing the invention, the inventor finds that at least the following technical problems exist in the prior art: at present, the software system only provides conversion of vo and entity objects, and the conversion type has limitation.
Disclosure of Invention
The invention provides an object conversion method, an object conversion device, electronic equipment and a storage medium, which are used for realizing conversion of various object types through a reflection mechanism.
According to an aspect of the present invention, there is provided an object conversion method including:
acquiring an object to be converted;
converting the object to be converted based on a static conversion rule to obtain a target type object, and assigning the attribute value of the object to be converted to the target type object;
wherein the static conversion rule realizes object conversion through a reflection mechanism.
According to another aspect of the present invention, there is provided an object converting apparatus including:
the object acquisition module is used for acquiring an object to be converted;
the object conversion module is used for converting the object to be converted based on a static conversion rule to obtain a target type object and assigning the attribute value of the object to be converted to the target type object;
wherein the static conversion rule realizes object conversion through a reflection mechanism.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the object transformation method according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the object transformation method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, the object to be converted is converted through the static conversion rule with the reflection mechanism to obtain the target type object, and the attribute value of the object to be converted is assigned to the target type object, so that the conversion of various object types can be realized according to the requirement.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of an object transformation method according to an embodiment of the present invention;
fig. 2 is a flowchart of an object transformation method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an object transformation apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing the object conversion method according to the embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "target," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of an object transformation method according to an embodiment of the present invention, where the embodiment is applicable to a case where objects between different hierarchies are automatically transformed, and the method may be executed by an object transformation apparatus, where the object transformation apparatus may be implemented in a form of hardware and/or software, and the object transformation apparatus may be configured in a terminal and/or a server. As shown in fig. 1, the method includes:
and S110, acquiring the object to be converted.
In this embodiment, the object to be converted refers to an incoming data transmission object. The type of the object to be converted can be selected or set in a user-defined manner according to requirements, and is not limited herein. For example, the type of the object to be converted may include, but is not limited to, a vo (value object) type, an entity type, a domain type, a query type, and other Java object types.
Specifically, the electronic device may retrieve the object to be converted from the configuration file or the preset path, which is not limited herein.
S120, converting the object to be converted based on a static conversion rule to obtain a target type object, and assigning the attribute value of the object to be converted to the target type object.
In the embodiment of the present invention, the static transformation rule refers to a preconfigured static transformation rule, and it should be noted that in the JAVA programming language, the static state refers to static keyword modification before a calling method or rule. Static conversion rules may implement object conversion through a reflection mechanism. The JAVA reflection mechanism refers to that in a running state, all attributes and methods of any class can be known; any method and property can be called for any object. In the embodiment, the object conversion is realized through a reflection mechanism, the types of the object conversion can be enriched, and the development workload can be saved.
It can be understood that the target type object refers to a data transmission object for conversion output, and the type of the target type object may be selected or set in a customized manner according to requirements, which is not limited herein. For example, the types of object type objects may include, but are not limited to, VO (value object) type, entity type, domain type, query type, and other Java object types. And in the process of object conversion, the attribute values of the objects to be converted can be assigned to the target type objects at the same time.
On the basis of the above embodiment, assigning the attribute value of the object to be converted to the target type object includes: and calling a get function and a set function, and assigning the attribute value of the object to be converted to the target type object through the get function and the set function.
The get function and the set function are a get method and a set method in the JAVA program respectively.
Specifically, a get function and a set function can be automatically called through a reflection mechanism, and an attribute value is stored/taken through the get function and the set function, so that the attribute value of the object to be converted is assigned to the target type object.
On the basis of the above embodiment, before assigning the attribute value of the object to be converted to the target type object, the method further includes: and initializing the target type object, and if the initialization fails, throwing an exception.
It is to be understood that the attribute values of the object to be converted may be assigned to the target type object only after the target type object has been initialized.
On the basis of the above embodiment, after the obtaining the object to be converted, the method further includes: and judging whether the incoming parameters are null or not, and if the incoming parameters are null, returning null characters.
Wherein the incoming parameters may include an object to be converted and a target type object.
Illustratively, the implementation process of assigning the attribute value of the object to be converted to the target type object is specifically as follows:
when the incoming parameter is null, directly returning to null;
when the incoming parameter is not null:
the target type object (i.e., output object) nxtObj is initialized, and if the initialization fails, an exception is thrown. According to the attribute of the input object to be converted, the same attribute of the output object nxtObj is assigned:
acquiring a get method corresponding to the preObj attribute, and assigning a value to a getMethod;
acquiring a corresponding value of a preObj attribute, assigning the value to a paraObject, and if an abnormal error report occurs, upwards throwing the abnormality, wherein the abnormal error report comprises java.
Acquiring the parameter type of a set method corresponding to the nxtObj attribute, and assigning the parameter type to setMethodParaClass;
acquiring a set method corresponding to the nxtObj attribute, and assigning the set method to a setMethod;
the corresponding attribute of nxtObj is assigned a value.
According to the technical scheme of the embodiment of the invention, the object to be converted is converted through the static conversion rule with the reflection mechanism to obtain the target type object, and the attribute value of the object to be converted is assigned to the target type object, so that the conversion of various object types can be realized according to the requirement.
Example two
Fig. 2 is a flowchart of an object conversion method according to a second embodiment of the present invention, where "converting the object to be converted based on the static conversion rule to obtain the target type object" is refined in this embodiment based on the above embodiment.
As shown in fig. 2, the method includes:
and S210, acquiring the object to be converted.
S220, converting the object to be converted to obtain a target type object based on a static conversion rule, wherein the static conversion rule comprises at least one of a domain type object converting VO type object rule, a query type object converting domain type object rule, and a rule of converting a VO type object list stored in the target type object.
It should be noted that the static conversion rule of this embodiment is set by self-definition in advance, and is data that can be modified or added, so that the degree of freedom of object conversion is improved, and thus, conversion of multiple object types can be implemented as required.
On the basis of the above embodiment, the static conversion rule includes a domain type object conversion VO type object rule; correspondingly, based on the static conversion rule, converting the object to be converted to obtain the target type object, including: and converting the object to be converted in the domain type based on the VO type object conversion rule of the domain type object to obtain the target type object in the VO type.
Illustratively, the implementation process of converting the object to be converted based on the static conversion rule is as follows:
public static<DM extends AbstractIdEntity,VO extends AbstractVO>VO domainToVO(DM domain,Class<VO>clazz)throws Exception。
the method is a public static method, and the specific parameters are as follows:
general parameters:
DM inherits the domain type of AbstractIdEntity;
the VO inherits the VO type of the AbstractVO;
inputting parameters:
DM type object to which domain is converted;
clazz is the type of the conversion output object, same as VO;
abnormal throwing:
all the exceptions are packaged into java.lang.exception for throwing;
the implementation method comprises the following steps:
{
return objTrans(domain,clazz);
}。
on the basis of the above embodiment, the static conversion rule includes a query type object conversion domain type object rule; correspondingly, based on the static conversion rule, converting the object to be converted to obtain the target type object, including: and converting the object to be converted of the query type based on the query type object conversion domain type object rule to obtain a target type object of the domain type.
Illustratively, the implementation process of converting the object to be converted based on the static conversion rule is as follows:
Public static<QR extends RichQuery,DM extends AbstractIdEntity>DM queryToDomain(QR query,Class<DM>clazz)throws Exception。
the method is a public static method, and the specific parameters are as follows:
general parameters:
QR inherits the query type of RichQuery;
DM inherits the domain type of AbstractIdEntity;
inputting parameters:
query a converted QR type object;
clazz is the type of the conversion output object, same as DM;
abnormal throwing:
all the exceptions are packaged into java.lang.exception for throwing;
the implementation method comprises the following steps:
{
return objTrans(query,clazz);
}。
on the basis of the above embodiment, the static conversion rule includes a rule that a VO type object list is stored and a domain type object list is stored; correspondingly, based on the static conversion rule, converting the object to be converted to obtain the target type object, including: and converting the object list to be converted, in which the VO type is stored, based on the rule that the VO type object list is stored and the domain type object list is stored, so as to obtain a target type object list in which the domain type is stored.
Illustratively, the implementation process of converting the object to be converted based on the static conversion rule is as follows:
public static<DM extends AbstractIdEntity,VO extends AbstractVO>List<VO>domainListToVoList(List<DM>domains,Class<VO>clazz)。
the method is a public static method, and the specific parameters are as follows:
general parameters:
DM inherits the domain type of AbstractIdEntity;
the VO inherits the VO type of the AbstractVO;
inputting parameters:
java.util.list < DM > type object with domains converted;
clazz is the general type of the conversion output list, and is the same as VO;
abnormal throwing:
all the exceptions of the method are packaged into java.
According to the technical scheme of the embodiment of the invention, the object to be converted is converted through the static conversion rule with the reflection mechanism to obtain the target type object, and the attribute value of the object to be converted is assigned to the target type object. It should be noted that the static conversion rule of this embodiment is set by self-definition in advance, and is data that can be modified or added, so that the degree of freedom of object conversion is improved, and thus, conversion of multiple object types can be implemented as required.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an object transformation apparatus according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes:
an object obtaining module 310, configured to obtain an object to be converted;
the object conversion module 320 is configured to convert the object to be converted based on a static conversion rule to obtain a target type object, and assign an attribute value of the object to be converted to the target type object;
wherein the static conversion rule realizes object conversion through a reflection mechanism.
According to the technical scheme of the embodiment of the invention, the object to be converted is converted through the static conversion rule with the reflection mechanism to obtain the target type object, and the attribute value of the object to be converted is assigned to the target type object, so that the conversion of various object types can be realized according to the requirement.
Optionally, the object converting module 320 is further configured to:
and calling a get function and a set function, and assigning the attribute value of the object to be converted to the target type object through the get function and the set function.
Optionally, the object transformation apparatus is further configured to:
and initializing the target type object, and if the initialization fails, throwing an exception.
Optionally, the object transformation apparatus is further configured to:
and judging whether the incoming parameters are null or not, and if the incoming parameters are null, returning null characters.
Optionally, the static conversion rule includes a domain type object conversion VO type object rule; accordingly, the object transformation module 320 is further configured to:
and converting the object to be converted of the domain type based on the VO type object conversion rule of the domain type object to obtain a target type object of the VO type.
Optionally, the static conversion rule includes a query type object conversion domain type object rule; accordingly, the object transformation module 320 is further configured to:
and converting the object to be converted of the query type based on the query type object conversion domain type object rule to obtain a target type object of the domain type.
Optionally, the static conversion rule includes a rule that a type object list is stored and converted into a domain type object list; accordingly, the object transformation module 320 is further configured to:
and converting the object list with the VO type to be converted based on the rule that the VO type object list is stored into the domain type object list, so as to obtain the target type object list with the domain type.
The object conversion device provided by the embodiment of the invention can execute the object conversion method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 4 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The processor 11 performs the various methods and processes described above, such as the object conversion method, which includes:
acquiring an object to be converted;
converting the object to be converted based on a static conversion rule to obtain a target type object, and assigning the attribute value of the object to be converted to the target type object;
wherein the static conversion rule realizes object conversion through a reflection mechanism.
In some embodiments, the object transformation method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the object conversion method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the object transformation method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An object conversion method, comprising:
acquiring an object to be converted;
converting the object to be converted based on a static conversion rule to obtain a target type object, and assigning the attribute value of the object to be converted to the target type object;
wherein the static conversion rule realizes object conversion through a reflection mechanism.
2. The method according to claim 1, wherein assigning the attribute value of the object to be transformed to the target type object comprises:
and calling a get function and a set function, and assigning the attribute value of the object to be converted to the target type object through the get function and the set function.
3. The method according to claim 1, further comprising, before said assigning the attribute value of the object to be transformed to the target type object:
and initializing the target type object, and if the initialization fails, throwing an exception.
4. The method according to any one of claims 1-3, further comprising, after said obtaining the object to be transformed:
and judging whether the incoming parameters are null or not, and if the incoming parameters are null, returning null characters.
5. The method of claim 1, wherein the static conversion rules include domain type object conversion VO type object rules;
correspondingly, based on the static conversion rule, converting the object to be converted to obtain the target type object, including:
and converting the object to be converted in the domain type based on the VO type object conversion rule of the domain type object to obtain the target type object in the VO type.
6. The method of claim 1, wherein the static conversion rules include query type object to domain type object rules;
correspondingly, based on the static conversion rule, converting the object to be converted to obtain the target type object, including:
and converting the object to be converted of the query type based on the query type object conversion domain type object rule to obtain a target type object of the domain type.
7. The method of claim 1, wherein said static conversion rules include rules that store VO type object list into domain type object list;
correspondingly, based on the static conversion rule, converting the object to be converted to obtain the target type object, including:
and converting the object list to be converted, in which the VO type is stored, based on the rule that the VO type object list is stored and the domain type object list is stored, so as to obtain a target type object list in which the domain type is stored.
8. An object conversion apparatus, characterized by comprising:
the object acquisition module is used for acquiring an object to be converted;
the object conversion module is used for converting the object to be converted based on a static conversion rule to obtain a target type object and assigning the attribute value of the object to be converted to the target type object;
wherein the static conversion rule realizes object conversion through a reflection mechanism.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the object transformation method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the object transformation method of any one of claims 1-7 when executed.
CN202210790689.7A 2022-07-05 2022-07-05 Object conversion method and device, electronic equipment and storage medium Pending CN115061664A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210790689.7A CN115061664A (en) 2022-07-05 2022-07-05 Object conversion method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210790689.7A CN115061664A (en) 2022-07-05 2022-07-05 Object conversion method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115061664A true CN115061664A (en) 2022-09-16

Family

ID=83204027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210790689.7A Pending CN115061664A (en) 2022-07-05 2022-07-05 Object conversion method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115061664A (en)

Similar Documents

Publication Publication Date Title
CN113342345A (en) Operator fusion method and device of deep learning framework
CN112269706B (en) Interface parameter verification method, device, electronic equipment and computer readable medium
CN114816393B (en) Information generation method, device, equipment and storage medium
CN114911598A (en) Task scheduling method, device, equipment and storage medium
CN115421922A (en) Current limiting method, device, equipment, medium and product of distributed system
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN116155604A (en) Container network micro-isolation protection method, device, equipment and storage medium
CN115309730A (en) Data auditing method and device, electronic equipment and storage medium
CN115061664A (en) Object conversion method and device, electronic equipment and storage medium
CN115168358A (en) Database access method and device, electronic equipment and storage medium
CN114218313A (en) Data management method, device, electronic equipment, storage medium and product
CN112968876A (en) Content sharing method and device, electronic equipment and storage medium
CN112596922B (en) Communication management method, device, equipment and medium
CN113595870B (en) Push message processing method and device, electronic equipment and storage medium
CN114428646B (en) Data processing method and device, electronic equipment and storage medium
CN113342413B (en) Method, apparatus, device, medium, and article for processing components
CN117081939A (en) Traffic data processing method, device, equipment and storage medium
CN115983222A (en) EasyExcel-based file data reading method, device, equipment and medium
CN115576977A (en) Data paging query method and device, electronic equipment and storage medium
CN114896322A (en) JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium
CN114579494A (en) Interface calling method, device, equipment and medium
CN115913954A (en) Cluster management information interaction method, device, equipment and storage medium
CN115480922A (en) Resource information processing method, device, electronic equipment and storage medium
CN117806702A (en) Target software acquisition method and device, electronic equipment and storage medium
CN117294597A (en) Network card binding configuration method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination